C# Class GameGraphics.GraphicsModel

显示文件 Open project: pmyoung/Advanced-Game-Project Class Usage Examples

Public Methods

Method Description
GetAsDictionary ( ) : GraphicsObject>.Dictionary

When called will return a reference to the dictionary it uses

GetAsList ( ) : List

When called wil return the dictionary in a List format of its values to allow iteration.

GetObjectWithID ( int id ) : GraphicsObject

Returns the GraphicsObject with the given ID if no object with this ID exists then it returns null

GraphicsModel ( ) : System

Default Constructor that initializes the dictionary

Remove ( int id ) : System.Boolean

Attempts to remove a GraphicsObject with the specified ID from the dictionary

Update ( GraphicsObject obj ) : void

Update takes a GraphicsObject as a parameter. If there is an object with the same ID we will update the existing object with the new info otherwise we add the object to our dictionary of object

Method Details

GetAsDictionary() public method

When called will return a reference to the dictionary it uses
public GetAsDictionary ( ) : GraphicsObject>.Dictionary
return GraphicsObject>.Dictionary

GetAsList() public method

When called wil return the dictionary in a List format of its values to allow iteration.
public GetAsList ( ) : List
return List

GetObjectWithID() public method

Returns the GraphicsObject with the given ID if no object with this ID exists then it returns null
public GetObjectWithID ( int id ) : GraphicsObject
id int the ID of the GraphicsObject
return GraphicsObject

GraphicsModel() public method

Default Constructor that initializes the dictionary
public GraphicsModel ( ) : System
return System

Remove() public method

Attempts to remove a GraphicsObject with the specified ID from the dictionary
public Remove ( int id ) : System.Boolean
id int the unique ID of the Graphics object to be removed.
return System.Boolean

Update() public method

Update takes a GraphicsObject as a parameter. If there is an object with the same ID we will update the existing object with the new info otherwise we add the object to our dictionary of object
public Update ( GraphicsObject obj ) : void
obj GraphicsObject The object that needs to be updated
return void