![]() |
BomberUnits
...a Unity learning project
|
Holds one of the colors players can choose. More...
Collaboration diagram for ColorScheme:Public Member Functions | |
| ColorScheme (Color color) | |
| Constructor, taking the single relevant property wrapped by this class. More... | |
| void | Register () |
| bool | IsInUse () |
| void | Use () |
| void | Free () |
| void | UseInsteadOf (ColorScheme previous) |
| Color | GetValue () |
Static Public Member Functions | |
| static ColorScheme | FromKey (int dictKey) |
| Returns the saved instance of this class with the fitting key. | |
| static IEnumerable< ColorScheme > | GetAll () |
| Returns all instances of this class. | |
| static ColorScheme | GetNextUnused () |
| Returns the first instance of this class, which is not marked as taken. | |
| static implicit | operator Color (ColorScheme c) |
| Implicit conversion to the held property made possible. Cool. | |
Public Attributes | |
| Color | color |
| The Unity color represented by this player property. | |
Properties | |
| int | dictKey [get, private set] |
Private Attributes | |
| bool | inUse |
| Whether this has been chosen already by a player. | |
Static Private Attributes | |
| static Dictionary< int, ColorScheme > | instances = new Dictionary<int, ColorScheme>() |
| The dict for this property holds all instances, referenced by their int keys. | |
Holds one of the colors players can choose.
A list of available colors is kept in player management One color is assigned to each local player, marking this color as taken in the process. Each instance is registered by the GameSettings during setup and is assigned a key as ID. This allows saving and restoring, as well as slim transmission of these properties via their key.
Definition at line 11 of file ColorScheme.cs.
|
inline |
Constructor, taking the single relevant property wrapped by this class.
Definition at line 71 of file ColorScheme.cs.
|
inline |
Definition at line 77 of file ColorScheme.cs.