Difference between revisions of "NetExaltedXP/NetExalted"
From Exalted - Unofficial Wiki
m (link fix) |
m (link fix) |
||
Line 1: | Line 1: | ||
== [[NetExalted]] Class == | == [[NetExalted]] Class == | ||
− | The [[NetExalted]] Class is the heart of the program. It holds and manages the top-level data structures, particularly the [[NetExaltedXP/NetExalted/Character]] library and the [[NetExaltedXP/NetExalted/Trait]] library. It also stores the current 'rules set', which covers the basic, core definitions of the rules as well as the type of [[NetExaltedXP/NetExalted/Character]] being made. These two are stored and read separately for modularity purposes. | + | The [[NetExalted]] Class is the heart of the program. It holds and manages the top-level data structures, particularly the[[NetExaltedXP/NetExalted/Character]] library and the[[NetExaltedXP/NetExalted/Trait]] library. It also stores the current 'rules set', which covers the basic, core definitions of the rules as well as the type of[[NetExaltedXP/NetExalted/Character]] being made. These two are stored and read separately for modularity purposes. |
− | This Class handles data | + | This Class handles data I/O (but not user-friendly output such as to screen, .pdf saving or printing). It also returns basic data, such as base traits. |
* Specification of a configuration file is probably desirable. Likely using the same .xml format that it runs on, so it can edit its own configuration. | * Specification of a configuration file is probably desirable. Likely using the same .xml format that it runs on, so it can edit its own configuration. | ||
=== Data Members === | === Data Members === | ||
− | * Character Array (an array of class [[NetExaltedXP/NetExalted/Character]]) - possibly a doubly linked list. There is likely little overhead for capping the number of Characters, however, and just making it an array. | + | * Character Array (an array of class[[NetExaltedXP/NetExalted/Character]]) - possibly a doubly linked list. There is likely little overhead for capping the number of Characters, however, and just making it an array. |
− | * Trait Array (an array of class [[NetExaltedXP/NetExalted/Trait]]) | + | * Trait Array (an array of class[[NetExaltedXP/NetExalted/Trait]]) |
− | * Base Array (an array of class [[NetExaltedXP/NetExalted/Data]]) | + | * Base Array (an array of class[[NetExaltedXP/NetExalted/Data]]) |
* Basefile (a string containing the filename for the Base rules) | * Basefile (a string containing the filename for the Base rules) | ||
* Trait files (an array of strings containing the filenames of the traits in use. | * Trait files (an array of strings containing the filenames of the traits in use. | ||
* Front End class - a hook for the GUI and other such things. | * Front End class - a hook for the GUI and other such things. | ||
=== Private Function Members === | === Private Function Members === | ||
− | * boolean <nowiki>WriteXMLFile</nowiki> (Array of [[NetExaltedXP/NetExalted/Data]], File Name) | + | * boolean <nowiki>WriteXMLFile</nowiki> (Array of[[NetExaltedXP/NetExalted/Data]], File Name) |
− | * (Array of [[NetExaltedXP/NetExalted/Data]]) <nowiki>ReadXMLFile</nowiki> (File Name) | + | * (Array of[[NetExaltedXP/NetExalted/Data]]) <nowiki>ReadXMLFile</nowiki> (File Name) |
− | ** (Array of [[NetExaltedXP/NetExalted/Data]]) <nowiki>ReadBase</nowiki> (File Name) | + | ** (Array of[[NetExaltedXP/NetExalted/Data]]) <nowiki>ReadBase</nowiki> (File Name) |
− | ** (Array of [[NetExaltedXP/NetExalted/Trait]]) <nowiki>ReadTraits</nowiki> (File Name) | + | ** (Array of[[NetExaltedXP/NetExalted/Trait]]) <nowiki>ReadTraits</nowiki> (File Name) |
− | *** (Array of [[NetExaltedXP/NetExalted/Data]]) <nowiki>ReadSingleTrait</nowiki> (File Name) | + | *** (Array of[[NetExaltedXP/NetExalted/Data]]) <nowiki>ReadSingleTrait</nowiki> (File Name) |
*** boolean <nowiki>CheckTraitProperties</nowiki> (Trait Name) - As Traits are getting read, this function will ensure that the proper fields are set up. | *** boolean <nowiki>CheckTraitProperties</nowiki> (Trait Name) - As Traits are getting read, this function will ensure that the proper fields are set up. | ||
− | * (pointer to [[NetExaltedXP/NetExalted/Character]]) <nowiki>FindCharacter</nowiki> (Character Name) - returns a pointer to the Character requested by <nowiki>CharacterName</nowiki>, for <nowiki>SetValue</nowiki> | + | * (pointer to[[NetExaltedXP/NetExalted/Character]]) <nowiki>FindCharacter</nowiki> (Character Name) - returns a pointer to the Character requested by <nowiki>CharacterName</nowiki>, for <nowiki>SetValue</nowiki> |
=== Public Function Members === | === Public Function Members === | ||
− | * (pointer to [[NetExaltedXP/NetExalted/Trait]]) <nowiki>GetTrait</nowiki> (Trait Name) | + | * (pointer to[[NetExaltedXP/NetExalted/Trait]]) <nowiki>GetTrait</nowiki> (Trait Name) |
− | * (Array of [[NetExaltedXP/NetExalted/Data]]) <nowiki>GetTraitTypes</nowiki> () - A 'get base rules' function. | + | * (Array of[[NetExaltedXP/NetExalted/Data]]) <nowiki>GetTraitTypes</nowiki> () - A 'get base rules' function. |
− | * (Array of [[NetExaltedXP/NetExalted/Data]]) <nowiki>GetTraitList</nowiki> (Trait Type) - Not typically called by the [[NetExaltedXP/NetExalted/Character]] class but rather the Front End class. When the user attempts to set a value for a trait that her character does not currently have, the Character will attempt to request the Trait (via <nowiki>GetTrait</nowiki>) and handle it accordingly. | + | * (Array of[[NetExaltedXP/NetExalted/Data]]) <nowiki>GetTraitList</nowiki> (Trait Type) - Not typically called by the[[NetExaltedXP/NetExalted/Character]] class but rather the Front End class. When the user attempts to set a value for a trait that her character does not currently have, the Character will attempt to request the Trait (via <nowiki>GetTrait</nowiki>) and handle it accordingly. |
− | * (Array of [[NetExaltedXP/NetExalted/Data]]) <nowiki>GetRequiredTraits</nowiki> () - Some Traits will have a required flag (every creature has some sort of Stamina score, for example). This works like <nowiki>GetTraitList</nowiki>, except it is mainly called by the [[NetExaltedXP/NetExalted/Character]] class | + | * (Array of[[NetExaltedXP/NetExalted/Data]]) <nowiki>GetRequiredTraits</nowiki> () - Some Traits will have a required flag (every creature has some sort of Stamina score, for example). This works like <nowiki>GetTraitList</nowiki>, except it is mainly called by the[[NetExaltedXP/NetExalted/Character]] class |
* int <nowiki>SetValue</nowiki> (Character Name, Trait Name, Value) - A function called by the Front End to set a Trait value for a specific character. All inputs are strings. This returns an int, instead of a boolean, because a signal will be needed to tell if <nowiki>GetCharacter</nowiki> must be called. Also used to tell why a certain action has been rejected - not enough BPs, XP, Set too low, set too high - whatever. | * int <nowiki>SetValue</nowiki> (Character Name, Trait Name, Value) - A function called by the Front End to set a Trait value for a specific character. All inputs are strings. This returns an int, instead of a boolean, because a signal will be needed to tell if <nowiki>GetCharacter</nowiki> must be called. Also used to tell why a certain action has been rejected - not enough BPs, XP, Set too low, set too high - whatever. | ||
− | * (Array of [[NetExaltedXP/NetExalted/Data]]) <nowiki>GetCharacter</nowiki> (Character Name) - Retrieves a character. Used for New Characters, debugging and sanity checks. | + | * (Array of[[NetExaltedXP/NetExalted/Data]]) <nowiki>GetCharacter</nowiki> (Character Name) - Retrieves a character. Used for New Characters, debugging and sanity checks. |
== Comments == | == Comments == |
Revision as of 01:17, 6 April 2010
Contents
NetExalted Class
The NetExalted Class is the heart of the program. It holds and manages the top-level data structures, particularly theNetExaltedXP/NetExalted/Character library and theNetExaltedXP/NetExalted/Trait library. It also stores the current 'rules set', which covers the basic, core definitions of the rules as well as the type ofNetExaltedXP/NetExalted/Character being made. These two are stored and read separately for modularity purposes.
This Class handles data I/O (but not user-friendly output such as to screen, .pdf saving or printing). It also returns basic data, such as base traits.
- Specification of a configuration file is probably desirable. Likely using the same .xml format that it runs on, so it can edit its own configuration.
Data Members
- Character Array (an array of classNetExaltedXP/NetExalted/Character) - possibly a doubly linked list. There is likely little overhead for capping the number of Characters, however, and just making it an array.
- Trait Array (an array of classNetExaltedXP/NetExalted/Trait)
- Base Array (an array of classNetExaltedXP/NetExalted/Data)
- Basefile (a string containing the filename for the Base rules)
- Trait files (an array of strings containing the filenames of the traits in use.
- Front End class - a hook for the GUI and other such things.
Private Function Members
- boolean WriteXMLFile (Array ofNetExaltedXP/NetExalted/Data, File Name)
- (Array ofNetExaltedXP/NetExalted/Data) ReadXMLFile (File Name)
- (Array ofNetExaltedXP/NetExalted/Data) ReadBase (File Name)
- (Array ofNetExaltedXP/NetExalted/Trait) ReadTraits (File Name)
- (Array ofNetExaltedXP/NetExalted/Data) ReadSingleTrait (File Name)
- boolean CheckTraitProperties (Trait Name) - As Traits are getting read, this function will ensure that the proper fields are set up.
- (pointer toNetExaltedXP/NetExalted/Character) FindCharacter (Character Name) - returns a pointer to the Character requested by CharacterName, for SetValue
Public Function Members
- (pointer toNetExaltedXP/NetExalted/Trait) GetTrait (Trait Name)
- (Array ofNetExaltedXP/NetExalted/Data) GetTraitTypes () - A 'get base rules' function.
- (Array ofNetExaltedXP/NetExalted/Data) GetTraitList (Trait Type) - Not typically called by theNetExaltedXP/NetExalted/Character class but rather the Front End class. When the user attempts to set a value for a trait that her character does not currently have, the Character will attempt to request the Trait (via GetTrait) and handle it accordingly.
- (Array ofNetExaltedXP/NetExalted/Data) GetRequiredTraits () - Some Traits will have a required flag (every creature has some sort of Stamina score, for example). This works like GetTraitList, except it is mainly called by theNetExaltedXP/NetExalted/Character class
- int SetValue (Character Name, Trait Name, Value) - A function called by the Front End to set a Trait value for a specific character. All inputs are strings. This returns an int, instead of a boolean, because a signal will be needed to tell if GetCharacter must be called. Also used to tell why a certain action has been rejected - not enough BPs, XP, Set too low, set too high - whatever.
- (Array ofNetExaltedXP/NetExalted/Data) GetCharacter (Character Name) - Retrieves a character. Used for New Characters, debugging and sanity checks.