C# Class Depressurizer.GameInfo

Represents a single game and its categories.
Exibir arquivo Open project: Theo47/depressurizer Class Usage Examples

Public Properties

Property Type Description
Categories SortedSet
GameList GameList
Hidden bool
Id int
LastPlayed DateTime
Name string
Source GameListingSource

Public Methods

Method Description
AddCategory ( Category newCat ) : void

Adds a single category to this game. Does nothing if the category is already attached.

AddCategory ( ICollection newCats ) : void

Adds a list of categories to this game. Skips categories that are already attached.

ApplySource ( GameListingSource src ) : void
ClearCategories ( bool alsoClearFavorite = false ) : void

Removes all categories from this game. If true, removes the favorite category as well.

ContainsCategory ( Category c ) : bool

Check whether the game includes the given category

GameInfo ( int id, string name, GameList list, string executable = null ) : System

Construct a new GameInfo with no categories set.

GetCatString ( string ifEmpty = "", bool includeFavorite = false ) : string

Gets a string listing the game's assigned categories.

HasCategories ( bool includeFavorite = false ) : bool

Check to see if the game has any categories at all (except the Favorite category)

HasCategoriesExcept ( ICollection except ) : bool

Check to see if the game has any categories set that do not exist in the given list

IncludeGame ( Filter f ) : bool
IsFavorite ( ) : bool
RemoveCategory ( Category remCat ) : void

Removes a single category from this game. Does nothing if the category is not attached to this game.

RemoveCategory ( ICollection remCats ) : void

Removes a list of categories from this game. Skips categories that are not attached to this game.

SetCategories ( ICollection cats, bool preserveFavorite ) : void

Sets the categories for this game to exactly match the given list. Missing categories will be added and extra ones will be removed.

SetFavorite ( bool fav ) : void
SetHidden ( bool hide ) : void

Add or remove the hidden attribute for this game.

Method Details

AddCategory() public method

Adds a single category to this game. Does nothing if the category is already attached.
public AddCategory ( Category newCat ) : void
newCat Category Category to add
return void

AddCategory() public method

Adds a list of categories to this game. Skips categories that are already attached.
public AddCategory ( ICollection newCats ) : void
newCats ICollection A list of categories to add
return void

ApplySource() public method

public ApplySource ( GameListingSource src ) : void
src GameListingSource
return void

ClearCategories() public method

Removes all categories from this game. If true, removes the favorite category as well.
public ClearCategories ( bool alsoClearFavorite = false ) : void
alsoClearFavorite bool
return void

ContainsCategory() public method

Check whether the game includes the given category
public ContainsCategory ( Category c ) : bool
c Category Category to look for
return bool

GameInfo() public method

Construct a new GameInfo with no categories set.
public GameInfo ( int id, string name, GameList list, string executable = null ) : System
id int ID of the new game. Positive means it's the game's Steam ID, negative means it's a non-steam game.
name string Game title
list GameList
executable string
return System

GetCatString() public method

Gets a string listing the game's assigned categories.
public GetCatString ( string ifEmpty = "", bool includeFavorite = false ) : string
ifEmpty string Value to return if there are no categories
includeFavorite bool If true, include the favorite category.
return string

HasCategories() public method

Check to see if the game has any categories at all (except the Favorite category)
public HasCategories ( bool includeFavorite = false ) : bool
includeFavorite bool If true, will only return true if the game is not in the favorite category. If false, the favorite category is ignored.
return bool

HasCategoriesExcept() public method

Check to see if the game has any categories set that do not exist in the given list
public HasCategoriesExcept ( ICollection except ) : bool
except ICollection List of games to exclude from the check
return bool

IncludeGame() public method

public IncludeGame ( Filter f ) : bool
f Filter
return bool

IsFavorite() public method

public IsFavorite ( ) : bool
return bool

RemoveCategory() public method

Removes a single category from this game. Does nothing if the category is not attached to this game.
public RemoveCategory ( Category remCat ) : void
remCat Category Category to remove
return void

RemoveCategory() public method

Removes a list of categories from this game. Skips categories that are not attached to this game.
public RemoveCategory ( ICollection remCats ) : void
remCats ICollection Categories to remove
return void

SetCategories() public method

Sets the categories for this game to exactly match the given list. Missing categories will be added and extra ones will be removed.
public SetCategories ( ICollection cats, bool preserveFavorite ) : void
cats ICollection Set of categories to apply to this game
preserveFavorite bool
return void

SetFavorite() public method

public SetFavorite ( bool fav ) : void
fav bool
return void

SetHidden() public method

Add or remove the hidden attribute for this game.
public SetHidden ( bool hide ) : void
hide bool Whether the game should be hidden
return void

Property Details

Categories public_oe property

public SortedSet Categories
return SortedSet

GameList public_oe property

public GameList GameList
return GameList

Hidden public_oe property

public bool Hidden
return bool

Id public_oe property

public int Id
return int

LastPlayed public_oe property

public DateTime LastPlayed
return DateTime

Name public_oe property

public string Name
return string

Source public_oe property

public GameListingSource Source
return GameListingSource