C# Класс Depressurizer.GameInfo

Represents a single game and its categories.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Categories SortedSet
GameList GameList
Hidden bool
Id int
LastPlayed DateTime
Name string
Source GameListingSource

Открытые методы

Метод Описание
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.

Описание методов

AddCategory() публичный Метод

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
Результат void

AddCategory() публичный Метод

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
Результат void

ApplySource() публичный Метод

public ApplySource ( GameListingSource src ) : void
src GameListingSource
Результат void

ClearCategories() публичный Метод

Removes all categories from this game. If true, removes the favorite category as well.
public ClearCategories ( bool alsoClearFavorite = false ) : void
alsoClearFavorite bool
Результат void

ContainsCategory() публичный Метод

Check whether the game includes the given category
public ContainsCategory ( Category c ) : bool
c Category Category to look for
Результат bool

GameInfo() публичный Метод

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
Результат System

GetCatString() публичный Метод

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.
Результат string

HasCategories() публичный Метод

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.
Результат bool

HasCategoriesExcept() публичный Метод

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
Результат bool

IncludeGame() публичный Метод

public IncludeGame ( Filter f ) : bool
f Filter
Результат bool

IsFavorite() публичный Метод

public IsFavorite ( ) : bool
Результат bool

RemoveCategory() публичный Метод

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
Результат void

RemoveCategory() публичный Метод

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
Результат void

SetCategories() публичный Метод

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
Результат void

SetFavorite() публичный Метод

public SetFavorite ( bool fav ) : void
fav bool
Результат void

SetHidden() публичный Метод

Add or remove the hidden attribute for this game.
public SetHidden ( bool hide ) : void
hide bool Whether the game should be hidden
Результат void

Описание свойств

Categories публичное свойство

public SortedSet Categories
Результат SortedSet

GameList публичное свойство

public GameList GameList
Результат GameList

Hidden публичное свойство

public bool Hidden
Результат bool

Id публичное свойство

public int Id
Результат int

LastPlayed публичное свойство

public DateTime LastPlayed
Результат DateTime

Name публичное свойство

public string Name
Результат string

Source публичное свойство

public GameListingSource Source
Результат GameListingSource