Difference between revisions of "NetExalted/XNEPCoreClass"

From Exalted - Unofficial Wiki
Jump to: navigation, search
m (link fix)
m (Whoops, added data types)
(One intermediate revision by one other user not shown)
Line 1: Line 1:
* [[/XeriarProposal]] - Back to Proposal
+
* /XeriarProposal - Back to Proposal
 
== Core Class ==
 
== Core Class ==
 
The Core Class is the heart of the program.  It holds and manages the top-level data structures, particularly the Character library and the Trait library.  It also stores the current 'rules set', which covers the basic, core definitions of the rules as well as the type of Character being made.  These two are stored and read separately for modularity purposes.
 
The Core Class is the heart of the program.  It holds and manages the top-level data structures, particularly the Character library and the Trait library.  It also stores the current 'rules set', which covers the basic, core definitions of the rules as well as the type of Character being made.  These two are stored and read separately for modularity purposes.
  
The Core 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.
+
The Core 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
 
* Specification of a configuration file is probably desirable
* This is the class that would be called '[[NetExalted]]'
+
* This is the class that would be called 'NetExalted'
 
=== Data Members ===
 
=== Data Members ===
 
* Character Array (an array of class [[/XNEPCharacterClass|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 [[/XNEPCharacterClass|Character]]) - possibly a doubly linked list.  There is likely little overhead for capping the number of Characters, however, and just making it an array.
Line 15: Line 15:
 
* 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 [[/XNEPValueClass|Value]], File Name)
+
* boolean WriteXMLFile (Array of [[/XNEPValueClass|Value]], FileName)
* (Array of [[/XNEPValueClass|Value]]) <nowiki>ReadXMLFile</nowiki> (File Name)
+
* (Array of [[/XNEPValueClass|Value]]) ReadXMLFile (FileName)
** (Array of [[/XNEPValueClass|Value]]) <nowiki>ReadBase</nowiki> (File Name)
+
** (Array of [[/XNEPValueClass|Value]]) ReadBase (FileName)
** (Array of [[/XNEPTraitClass|Trait]]) <nowiki>ReadTraits</nowiki> (File Name)
+
** (Array of [[/XNEPTraitClass|Trait]]) ReadTraits (FileName)
*** (Array of [[/XNEPValueClass|Value]]) <nowiki>ReadSingleTrait</nowiki> (File Name)
+
*** (Array of [[/XNEPValueClass|Value]]) ReadSingleTrait (FileName)
*** boolean <nowiki>CheckTraitProperties</nowiki> (Trait Name) - As Traits are getting read, this function will ensure that the proper fields are set up.
+
*** boolean CheckTraitProperties (TraitName) - As Traits are getting read, this function will ensure that the proper fields are set up.
* (pointer to [[/XNEPCharacterClass|Character]]) <nowiki>FindCharacter</nowiki> (Character Name) - returns a pointer to the Character requested by <nowiki>CharacterName</nowiki>, for <nowiki>SetValue</nowiki>
+
* (pointer to [[/XNEPCharacterClass|Character]]) FindCharacter (CharacterName) - returns a pointer to the Character requested by CharacterName, for SetValue
 
=== Public Function Members ===
 
=== Public Function Members ===
* (pointer to [[/XNEPTraitClass|Trait]]) <nowiki>GetTrait</nowiki> (Trait Name)
+
* (pointer to [[/XNEPTraitClass|Trait]]) GetTrait (TraitName)
* (Array of [[/XNEPValueClass|Value]]) <nowiki>GetTraitTypes</nowiki> () - A 'get base rules' function.
+
* (Array of [[/XNEPValueClass|Value]]) GetTraitTypes () - A 'get base rules' function.
* (Array of [[/XNEPValueClass|Value]]) <nowiki>GetTraitList</nowiki> (Trait Type) - Not typically called by the [[/XNEPCharacterClass|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 [[/XNEPValueClass|Value]]) GetTraitList (TraitType) - Not typically called by the Character class but rather the FrontEnd 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 of [[/XNEPValueClass|Value]]) <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 [[/XNEPCharacterClass|Character]] class
+
* (Array of [[/XNEPValueClass|Value]]) 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 the 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 SetValue (CharacterName, TraitName, 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 of [[/XNEPValueClass|Value]]) <nowiki>GetCharacter</nowiki> (Character Name) - Retrieves a character.  Used for New Characters, debugging and sanity checks.
+
* (Array of [[/XNEPValueClass|Value]]) GetCharacter (CharacterName) - Retrieves a character.  Used for New Characters, debugging and sanity checks.
 
== Comments ==
 
== Comments ==

Revision as of 22:40, 26 January 2005

  • /XeriarProposal - Back to Proposal

Core Class

The Core Class is the heart of the program. It holds and manages the top-level data structures, particularly the Character library and the Trait library. It also stores the current 'rules set', which covers the basic, core definitions of the rules as well as the type of Character being made. These two are stored and read separately for modularity purposes.

The Core 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
  • This is the class that would be called 'NetExalted'

Data Members

  • Character Array (an array of class 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 Trait)
  • Base Array (an array of class Value)
  • 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 of Value, FileName)
  • (Array of Value) ReadXMLFile (FileName)
    • (Array of Value) ReadBase (FileName)
    • (Array of Trait) ReadTraits (FileName)
      • (Array of Value) ReadSingleTrait (FileName)
      • boolean CheckTraitProperties (TraitName) - As Traits are getting read, this function will ensure that the proper fields are set up.
  • (pointer to Character) FindCharacter (CharacterName) - returns a pointer to the Character requested by CharacterName, for SetValue

Public Function Members

  • (pointer to Trait) GetTrait (TraitName)
  • (Array of Value) GetTraitTypes () - A 'get base rules' function.
  • (Array of Value) GetTraitList (TraitType) - Not typically called by the Character class but rather the FrontEnd 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 of Value) 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 the Character class
  • int SetValue (CharacterName, TraitName, 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 of Value) GetCharacter (CharacterName) - Retrieves a character. Used for New Characters, debugging and sanity checks.

Comments