C# Класс Depressurizer.GameList

Represents a complete collection of games and categories.
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
Categories List
Filters List
Games GameInfo>.Dictionary

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

Метод Описание
AddCategory ( string name ) : Category

Adds a new category to the list.

AddFilter ( string name ) : Depressurizer.Filter

Adds a new Filter to the list.

AddGameCategory ( int gameID, Category c ) : void

Adds a single category to a single game

AddGameCategory ( int gameID, ICollection cats ) : void

Adds a set of categories to a single game

CategoryExists ( string name ) : bool

Checks to see if a category with the given name exists

Clear ( ) : void
ClearGameCategories ( int gameID, bool preserveFavorite ) : void

Clears all categories from a single game

ExportSteamConfig ( long steamId, bool discardMissing, bool includeShortcuts ) : void

Writes Steam game category information to Steam user config file.

ExportSteamConfigFile ( string filePath, bool discardMissing ) : void

Writes Steam game category information to Steam user config file.

ExportSteamShortcuts ( long SteamId ) : void

Writes category info for shortcut games to shortcuts.vdf config file for specified Steam user. Loads the shortcut config file, then tries to match each game in the file against one of the games in the gamelist. If it finds a match, it updates the config file with the new category info.

FetchHtmlFromUrl ( string url ) : string

Fetches an HTML game list and returns the full page text. Mostly just grabs the given HTTP response, except that it throws an errors if the profile is not public, and writes approrpriate log entries.

FetchHtmlGameList ( System.Int64 accountId ) : string

Grabs the HTML game list for the given account and returns its full text.

FetchHtmlGameList ( string customUrl ) : string

Grabs the HTML game list for the given account and returns its full text.

FetchXmlFromUrl ( string url ) : XmlDocument

Fetches an XML game list and loads it into an XML document.

FetchXmlGameList ( System.Int64 steamId ) : XmlDocument

Grabs the XML game list for the given account and reads it into an XmlDocument.

FetchXmlGameList ( string customUrl ) : XmlDocument

Grabs the XML game list for the given account and reads it into an XmlDocument.

FilterExists ( string name ) : bool

Checks to see if a Filter with the given name exists

GameList ( ) : System
GetCategory ( string name ) : Category

Gets the category with the given name. If the category does not exist, creates it.

GetFilter ( string name ) : Depressurizer.Filter

Gets the Filter with the given name. If the Filter does not exist, creates it.

HideGames ( int gameID, bool hide ) : void

Add or Remove the hidden attribute of a single game

ImportSteamConfig ( long SteamId, SortedSet ignore, AppTypes includedTypes, bool includeShortcuts ) : int

Loads category info from the steam config file for the given Steam user.

ImportSteamConfigFile ( string filePath, SortedSet ignore, AppTypes includedTypes ) : int

Loads category info from the given steam config file.

ImportSteamShortcuts ( long SteamId ) : int

Updates set of non-Steam games. Will remove any games that are currently in the list but not found in the Steam config.

IntegrateHtmlGameList ( string page, bool overWrite, SortedSet ignore, AppTypes includedTypes, int &newItems ) : int

Integrates list of games from an HTML page into the loaded game list.

IntegrateXmlGameList ( XmlDocument doc, bool overWrite, SortedSet ignore, AppTypes includedTypes, int &newItems ) : int

Integrates list of games from an XmlDocument into the loaded game list.

ProcessUnicode ( string val ) : string

Searches a string for HTML unicode entities ('\u####') and replaces them with actual unicode characters.

RemoveCategory ( Category c ) : bool

Removes the given category.

RemoveEmptyCategories ( ) : int

Remove all empty categories from the category list.

RemoveFilter ( Depressurizer.Filter f ) : bool

Removes the given Filter.

RemoveGameCategory ( int gameID, Category c ) : void

Removes a single category from a single game.

RemoveGameCategory ( int gameID, ICollection cats ) : void

Removes a set of categories from a single game

RenameCategory ( Category c, string newName ) : Category

Renames the given category.

SetGameCategories ( int gameID, Category cat, bool preserveFavorites ) : void
SetGameCategories ( int gameID, ICollection catSet, bool preserveFavorites ) : void

Sets a game's categories to a particular set

UpdateGameListFromOwnedPackageInfo ( System.Int64 accountId, SortedSet ignored, AppTypes includedTypes, int &newApps ) : int

Updates the game list based on data from the localconfig file and the package cache, including LastPlayed.

Приватные методы

Метод Описание
FindMatchingShortcut ( int shortcutId, VdfFileNode shortcutNode, List gamesToMatchAgainst, StringDictionary shortcutLaunchIds ) : int

Searches a list of games, looking for the one that matches the information in the shortcut node. Checks launch ID first, then checks a combination of name and ID, then just checks name.

GetLastPlayedFromVdf ( VdfFileNode appsNode, SortedSet ignore, AppTypes includedTypes ) : void

Get LastPlayed date from a VDF node containing a list of games. Any games in the node not found in the game list will be added to the gamelist.

IntegrateGame ( int appId, string appName, bool overwriteName, SortedSet ignore, AppTypes includedTypes, GameListingSource src, bool &isNew ) : GameInfo

Adds a new game to the database, or updates an existing game with new information.

IntegrateGamesFromVdf ( VdfFileNode appsNode, SortedSet ignore, AppTypes includedTypes ) : int

Loads in games from a VDF node containing a list of games. Any games in the node not found in the game list will be added to the gamelist. If a game in the node has a tags subnode, the "favorite" field will be overwritten. If a game in the node has a category set, it will overwrite any categories in the gamelist. If a game in the node does NOT have a category set, the category in the gamelist will NOT be cleared.

IntegrateShortcut ( int gameId, VdfFileNode gameNode, StringDictionary launchIds ) : bool

Adds a non-steam game to the gamelist.

LoadShortcutLaunchIds ( long SteamId, StringDictionary &shortcutLaunchIds ) : bool

Load launch IDs for external games from screenshots.vdf

RemoveGame ( int appId ) : bool

Removes a game from the game list.

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

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

Adds a new category to the list.
public AddCategory ( string name ) : Category
name string Name of the category to add
Результат Category

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

Adds a new Filter to the list.
public AddFilter ( string name ) : Depressurizer.Filter
name string Name of the Filter to add
Результат Depressurizer.Filter

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

Adds a single category to a single game
public AddGameCategory ( int gameID, Category c ) : void
gameID int Game ID to add category to
c Category Category to add
Результат void

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

Adds a set of categories to a single game
public AddGameCategory ( int gameID, ICollection cats ) : void
gameID int Game ID to add to
cats ICollection Categories to add
Результат void

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

Checks to see if a category with the given name exists
public CategoryExists ( string name ) : bool
name string Name of the category to look for
Результат bool

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

public Clear ( ) : void
Результат void

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

Clears all categories from a single game
public ClearGameCategories ( int gameID, bool preserveFavorite ) : void
gameID int Game ID to clear categories from
preserveFavorite bool
Результат void

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

Writes Steam game category information to Steam user config file.
public ExportSteamConfig ( long steamId, bool discardMissing, bool includeShortcuts ) : void
steamId long Steam ID of user to save the config file for
discardMissing bool If true, any pre-existing game entries in the file that do not have corresponding entries in the GameList are removed
includeShortcuts bool If true, also saves the Steam shortcut category data
Результат void

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

Writes Steam game category information to Steam user config file.
public ExportSteamConfigFile ( string filePath, bool discardMissing ) : void
filePath string Full path of the steam config file to save
discardMissing bool If true, any pre-existing game entries in the file that do not have corresponding entries in the GameList are removed
Результат void

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

Writes category info for shortcut games to shortcuts.vdf config file for specified Steam user. Loads the shortcut config file, then tries to match each game in the file against one of the games in the gamelist. If it finds a match, it updates the config file with the new category info.
public ExportSteamShortcuts ( long SteamId ) : void
SteamId long Identifier of Steam user to save information
Результат void

FetchHtmlFromUrl() публичный статический Метод

Fetches an HTML game list and returns the full page text. Mostly just grabs the given HTTP response, except that it throws an errors if the profile is not public, and writes approrpriate log entries.
public static FetchHtmlFromUrl ( string url ) : string
url string The URL to fetch
Результат string

FetchHtmlGameList() публичный статический Метод

Grabs the HTML game list for the given account and returns its full text.
public static FetchHtmlGameList ( System.Int64 accountId ) : string
accountId System.Int64 The 64-bit account ID
Результат string

FetchHtmlGameList() публичный статический Метод

Grabs the HTML game list for the given account and returns its full text.
public static FetchHtmlGameList ( string customUrl ) : string
customUrl string The custom name for the account
Результат string

FetchXmlFromUrl() публичный статический Метод

Fetches an XML game list and loads it into an XML document.
public static FetchXmlFromUrl ( string url ) : XmlDocument
url string The URL to fetch
Результат System.Xml.XmlDocument

FetchXmlGameList() публичный статический Метод

Grabs the XML game list for the given account and reads it into an XmlDocument.
public static FetchXmlGameList ( System.Int64 steamId ) : XmlDocument
steamId System.Int64
Результат System.Xml.XmlDocument

FetchXmlGameList() публичный статический Метод

Grabs the XML game list for the given account and reads it into an XmlDocument.
public static FetchXmlGameList ( string customUrl ) : XmlDocument
customUrl string The custom name for the account
Результат System.Xml.XmlDocument

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

Checks to see if a Filter with the given name exists
public FilterExists ( string name ) : bool
name string Name of the Filter to look for
Результат bool

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

public GameList ( ) : System
Результат System

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

Gets the category with the given name. If the category does not exist, creates it.
public GetCategory ( string name ) : Category
name string Name to get the category for
Результат Category

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

Gets the Filter with the given name. If the Filter does not exist, creates it.
public GetFilter ( string name ) : Depressurizer.Filter
name string Name to get the Filter for
Результат Depressurizer.Filter

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

Add or Remove the hidden attribute of a single game
public HideGames ( int gameID, bool hide ) : void
gameID int Game ID to hide/unhide
hide bool Whether the game should be hidden.
Результат void

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

Loads category info from the steam config file for the given Steam user.
public ImportSteamConfig ( long SteamId, SortedSet ignore, AppTypes includedTypes, bool includeShortcuts ) : int
SteamId long Identifier of Steam user
ignore SortedSet Set of games to ignore
includedTypes AppTypes
includeShortcuts bool If true, also import shortcut data
Результат int

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

Loads category info from the given steam config file.
public ImportSteamConfigFile ( string filePath, SortedSet ignore, AppTypes includedTypes ) : int
filePath string The path of the file to open
ignore SortedSet Set of game IDs to ignore
includedTypes AppTypes
Результат int

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

Updates set of non-Steam games. Will remove any games that are currently in the list but not found in the Steam config.
public ImportSteamShortcuts ( long SteamId ) : int
SteamId long The ID64 of the account to load shortcuts for
Результат int

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

Integrates list of games from an HTML page into the loaded game list.
public IntegrateHtmlGameList ( string page, bool overWrite, SortedSet ignore, AppTypes includedTypes, int &newItems ) : int
page string The full text of the page to load
overWrite bool If true, overwrite the names of games already in the list.
ignore SortedSet A set of item IDs to ignore. Can be null.
includedTypes AppTypes
newItems int The number of new items actually added
Результат int

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

Integrates list of games from an XmlDocument into the loaded game list.
public IntegrateXmlGameList ( XmlDocument doc, bool overWrite, SortedSet ignore, AppTypes includedTypes, int &newItems ) : int
doc System.Xml.XmlDocument The XmlDocument containing the new game list
overWrite bool If true, overwrite the names of games already in the list.
ignore SortedSet A set of item IDs to ignore.
includedTypes AppTypes
newItems int The number of new items actually added
Результат int

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

Searches a string for HTML unicode entities ('\u####') and replaces them with actual unicode characters.
public ProcessUnicode ( string val ) : string
val string The string to process
Результат string

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

Removes the given category.
public RemoveCategory ( Category c ) : bool
c Category Category to remove.
Результат bool

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

Remove all empty categories from the category list.
public RemoveEmptyCategories ( ) : int
Результат int

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

Removes the given Filter.
public RemoveFilter ( Depressurizer.Filter f ) : bool
f Depressurizer.Filter Filter to remove.
Результат bool

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

Removes a single category from a single game.
public RemoveGameCategory ( int gameID, Category c ) : void
gameID int Game ID to remove from
c Category Category to remove
Результат void

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

Removes a set of categories from a single game
public RemoveGameCategory ( int gameID, ICollection cats ) : void
gameID int Game ID to remove from
cats ICollection Set of categories to remove
Результат void

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

Renames the given category.
public RenameCategory ( Category c, string newName ) : Category
c Category Category to rename.
newName string Name to assign to the new category.
Результат Category

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

public SetGameCategories ( int gameID, Category cat, bool preserveFavorites ) : void
gameID int
cat Category
preserveFavorites bool
Результат void

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

Sets a game's categories to a particular set
public SetGameCategories ( int gameID, ICollection catSet, bool preserveFavorites ) : void
gameID int Game ID to modify
catSet ICollection Set of categories to apply
preserveFavorites bool If true, will not remove "favorite" category
Результат void

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

Updates the game list based on data from the localconfig file and the package cache, including LastPlayed.
public UpdateGameListFromOwnedPackageInfo ( System.Int64 accountId, SortedSet ignored, AppTypes includedTypes, int &newApps ) : int
accountId System.Int64 64-bit account ID to update for
ignored SortedSet Set of games to ignore
includedTypes AppTypes
newApps int
Результат int

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

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

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

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

public List Filters
Результат List

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

public Dictionary Games
Результат GameInfo>.Dictionary