[Crossfire-wiki] [Crossfire DokuWiki] page changed: user:rednaxela:refactor

no-reply_wiki at metalforge.org no-reply_wiki at metalforge.org
Wed Oct 4 18:07:24 CDT 2006


A page in your DokuWiki was added or changed. Here are the details:



Date        : 2006/10/04 18:07

User        : rednaxela

Edit Summary: Typo fixing



@@ -1,24 +1,24 @@

  **This page is a draft document in my user namespace. Will move to the d
ev_todo namespace when the draft is ready for public review**

  

  ----

  

- ====== Objec-type refactoring ======

+ ====== Object-type refactoring ======

  ===== Reason =====

- Currently in the crossfire code, how objects behave is intertwined all t
hroughout the code, and this is in many ways a problem as it makes it diff
icult to find code related to a type of object. It's current state also ma
kes it relatively difficult to add code for new object types. Though it wi
ll never be that easy to add object types, refactoring could improve this 
significantly. Also, refactoring this to seperate code for different objec
t types, will make it easier to find current overloading of object attribu
tes, making it easier to eventually refactor the overloading out.

+ Currently in the crossfire code, how objects behave is intertwined all t
hroughout the code, and this is in many ways a problem as it makes it diff
icult to find code related to a type of object. It's current state also ma
kes it relatively difficult to add code for new object types. Though it wi
ll never be that easy to add object types, refactoring could improve this 
significantly. Also, refactoring this to separate code for different objec
t types, will make it easier to find current overloading of object attribu
tes, making it easier to eventually refactor the overloading out.

  

  ===== Proposal =====

  ==== General Idea ====

-   * Allow operations such as 'apply' to be specified in pointers in all 
of the following ways, however only the last being used in the refactorign
 itself:

+   * Allow operations such as 'apply' to be specified in pointers in all 
of the following ways, however only the last being used in the refactoring
 itself:

      * By object

      * By archetype

      * By type number

-   * Seperate object type specific code into seperate files.

- ==== Implimentation Details ====

+   * Separate object type specific code into separate files.

+ ==== Implementation Details ====

  === Code organization ===

      * Use form of server/types/foo.c or server/types/foo/bar.c depending
 on if the object type requires multiple C files to be clean.

      * Code used by multiple distinct types, but is not generic to all ob
ject types should be put in server/types/common/ with a logical filename.

-     * Doesn't necessarly mean one type number per file, due to cases suc
h as different types of armor, where all behave the same but have differen
t type numbers.

+     * Doesn't necessarily mean one type number per file, due to cases su
ch as different types of armor, where all behave the same but have differe
nt type numbers.

  === Function pointers ===

  FIXME //planned but to be written//

  ===== Plan =====

  ==== To start ====

@@ -34,8 +34,8 @@

  ==== Later ====

    * Clean up the refactoring.

    * Attempt to get the remaining type-specific code moved into the syste
m.

  ==== Eventually... ====

-   * Impliment some sort of [[dev_todo:unified_event_system|unified event
 system]] and integrate with this object-type seperation. Not a priority r
ight now, but something to keep in mind for later.

+   * Implement some sort of [[dev_todo:unified_event_system|unified event
 system]] and integrate with this object-type separation. Not a priority r
ight now, but something to keep in mind for later.

  

  ===== More information =====

    * [[http://thread.gmane.org/gmane.games.crossfire.general/1928|Crossfi
re mailing list: Code restructuring]]





IP-Address  : 66.222.158.169

Old Revision: http://wiki.metalforge.net/doku.php/user:rednaxela:refactor?
rev=1159981841

New Revision: http://wiki.metalforge.net/doku.php/user:rednaxela:refactor



-- 

This mail was generated by DokuWiki at

http://wiki.metalforge.net/





More information about the crossfire-wiki mailing list