specs for the classes
Last updated at 12:14 pm UTC on 16 January 2006
17/01/00: Added object MostBasicUnit & God updated.
Object MostBasicUnit
Everything that wish to exist in SIM MORRO must be derived of this object or will not be compatible with God 1.0.
Instance Veriables:
- x, y, z, s: Cordinates and Size. Coordinates are used to locate objects in universe, size is obvious. a object size 2 can contain 2 objects size 1, a size 4 can contain a object size 3 and a object size 1, or two size 2 or four size 1... get the ideia?
- name, hp, cost: object's name, hit points (used to see if it is in perfect shape or damage, when hit zero, object must be destroyed) and cost (cost is another Object called CostDescriptor not yet documented).
- id: This is another Object called IdDescriptor used to describe ownership, who's linked to who, allies and other stuff like that.
- msg: a Heap used to store messages.
Method:
- update: This must update the object for next turn. Remeber during the execution of this method, object must register with God for the next turn or it will be forgotten.
- procmsg: Allow object to process a message from other object or God.
- sendmsg: msg : Send message to God.
- sendmsg: msg to: id: Send message to object.
Object God 1.1 (Great Object Deliver):
God is the scheduler, every existing thing in sim-morro must
also exist in god. every time cycle god will call each objects
update function, remember objects must register with god every
time cycle or they will cease to exist.
These are the functions related to God Functionality:
- God is composed of two Heaps (Stacks):
- Universe: Main Stack, everything inside is alive.
- UniverseBackup: Alive things are transfered to this limbo before updating so that no GodDammit object mess up with current universe.
- God Has 5 methods (God is simple!)
- New (create a new God).
- Add: item -> add item to universe (must be called by the wanting object each time cycle or the object will cease to exist)
- update (update de system)
- Scan: id Allow object linked to to scan its surround.
- Send msg to: id: Directly add msg to Object linked to id heap.
improvments/To Do list/Not Working yet:
- dump procedure (dumps universe to file.)
- load procedure (load universe from file.)
- Create Client software
- Create living and non-living beigns
- All The Rest.
Add Your 2 cents?