Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#9 closed enhancement (released)

Make WarFoundry API load files in small methods

Reported by: ibboard Owned by: ibboard
Priority: major Milestone: WarFoundry 0.1
Component: WarFoundry-API Version:
Keywords: Cc:
Blocked By: Blocking: #16, #17, #18

Description

The current staged file loading in WarFoundry is an "all at once" approach of loading the remaining data and then throwing it at the object. This should be replaced with a more granular version that loads data and follows links as necessary, adding each object to its parent individually where possible.

Change History (17)

comment:1 Changed 11 years ago by ibboard

(In r16) Re #9 - more granular loading

  • Remove SystemStatsSet class so that other classes don't know the internals of how GameSystem stores its stats (cleaner code principle)
  • Make XML loader each stats set and add to the game system
  • Add methods to GameSystem to remove use of SystemStatsSet and hide internal handling
  • Add methods to add SystemStats to GameSystem

comment:2 Changed 11 years ago by ibboard

(In r18) Re #9 - Make WarFoundry loading granular

  • Remove specific staged loading classes
  • Rework category loading for GameSystem and Race to make it use AddCategory(Category) method
  • Promote staged loading from Native Factory to all Factories level
  • Refactor XML Factory to use smaller methods

Also removed some commented code that isn't used any more

comment:3 Changed 11 years ago by ibboard

Blocking: 16 added

comment:4 Changed 11 years ago by ibboard

Blocking: 17 added

comment:5 Changed 11 years ago by ibboard

Blocking: 18 added

comment:6 Changed 11 years ago by ibboard

Status: newaccepted

comment:7 Changed 11 years ago by ibboard

(In r22) Re #9 - Make WarFoundry API load files in small methods

  • Add "add unit type" and "add equipment" methods to Race
  • Deprecate old "set unit types" and "set equipment" methods on Race
  • Update WarFoundryXmlFactory to use new methods
  • Create DuplicateItemException for later use

comment:8 Changed 11 years ago by ibboard

(In r23) Re #9 - Make WarFoundry API use smaller methods

  • Obselete old Category and UnitType constructors and add minimal constructors
  • Add setters to properties where needed
  • Add value sanity checking to Category and UnitType
  • Set default values for percentages, choices and points for Category
  • Make XML factory use new constructor and setter properties
  • Add DuplicateItemException to project file

comment:9 Changed 11 years ago by ibboard

(In r24) Re #9 - Make WarFoundry API use smaller methods

  • Use new UnitType constructor
  • Add units to race
  • Cascade up unit loading function hierarchy instead of jumping a step

comment:10 Changed 11 years ago by ibboard

(In r25) Re #9 - Load in smaller methods

  • Fix earlier commit that caused exceptions about already being in dictionary for first object by caching before adding

comment:11 Changed 11 years ago by ibboard

Milestone: WarFoundry 0.1

comment:12 Changed 11 years ago by ibboard

(In r89) Re #61 - Complete structure of WarFoundry API objects

  • Remove min/max from EquipmentItem and add description
  • Add min/max numbers and percentages to UnitEquipmentItem
  • Make Race schema define min/max number without the ratio (which is the percentage)
  • Replace use of EquipmentItem with UnitEquipmentItem because of increased use of UnitEquipmentItem for unit-specific data
  • Use doubles instead of floats for equipment amounts
  • Distinguish between ratio and absolute limits
  • Delete UnitEquipmentItemObj helper class that was purely used for UI

Re #9 - Use smaller methods

  • Deprecate long Race and EquipmentItem constructors and ensure all getters/setters exist

Also:

  • Migrate Unit to using genericed collections
  • Always use GameSystem object for Race, not ID string

comment:13 Changed 11 years ago by ibboard

(In r91) Re #9 - Refactor for small methods

  • Replace use of obsolete constructors with small constructors and property setting

comment:14 Changed 10 years ago by ibboard

Resolution: fixed
Status: acceptedclosed

Nothing is obviously loading in large chunks any more. Closing ticket.

comment:15 Changed 10 years ago by ibboard

released: 1

Mark released changes as released

comment:16 Changed 10 years ago by ibboard

released: 1yes

Mark released fixes as released using radio values

comment:17 Changed 10 years ago by ibboard

Resolution: fixedreleased

Mark fix as released under a previous version

Note: See TracTickets for help on using tickets.