Opened 9 years ago

Closed 8 years ago

#351 closed task (fixed)

Add extensible requirement handling method

Reported by: ibboard Owned by: ibboard
Priority: critical Milestone: WarFoundry API 0.2
Component: WarFoundry-API Version: Unknown or N/A
Keywords: Cc:
Blocked By: #52, #353 Blocking: #27

Description

We have a schema and a hard-coded way of loading a requirement, but to be really useful then we need an extensible model. This won't (initially) use the Plugin structure and will be done in code, but should be done in a way that adding extra requirements is easy.

The basic idea will be to have "requirement factories" that create requirement objects based on a unit type and a data string. These factories will also need registering, but should be compatible with all factory types.

Change History (16)

comment:1 Changed 9 years ago by ibboard

Owner: set to ibboard
Status: newaccepted

comment:2 Changed 9 years ago by ibboard

In [940]:

Re #351: Add extensible requirement handling method

  • Add test to check type of object

comment:3 Changed 9 years ago by ibboard

In [941]:

Re #351: Add extensible requirement handling method

  • First refactor of extensible requirement creation
    • Needs to return different types of factory
    • Needs to handle unit types that are currently not loaded

comment:4 Changed 9 years ago by ibboard

In [942]:

Re #351: Add extensible requirement handling method

  • Start testing requirement factory

comment:5 Changed 9 years ago by ibboard

In [943]:

Re #351: Add extensible requirement handling method

  • Pass unit test (assumes units are already loaded)

comment:6 Changed 9 years ago by ibboard

In [944]:

Re #351: Add extensible requirement handling method

  • Test multiple unit types and limit amounts

Still needs to test invalid data and partially loaded races (which is where it'll be used most)

comment:7 Changed 9 years ago by ibboard

In [945]:

Re #351: Add extensible requirement handling method

  • Add handling of different requirements:
    • Multiple unit types
    • Unit types with numbers

comment:8 Changed 9 years ago by ibboard

In [946]:

Re #351: Add extensible requirement handling method

  • Add initial conditional to fetching of factory
  • Exception if content isn't correct

comment:9 Changed 9 years ago by ibboard

In [947]:

Re #351: Add extensible requirement handling method

  • Add first test for failed loading

comment:10 Changed 9 years ago by ibboard

In [948]:

Re #351: Add extensible requirement handling method

  • Test exception messages
  • Test invalid numbers

comment:11 Changed 9 years ago by ibboard

In [949]:

Re #351: Add extensible requirement handling method

  • Wrap exception from integer parsing

comment:12 Changed 9 years ago by ibboard

Blocked By: 353 added

comment:13 Changed 8 years ago by ibboard

In [956]:

Re #351: Add extensible requirement handling method

  • Extract common IRequirementFactory interface
  • Drop back to just returning IRequirement from factory to simplify generics
  • Add initial registration of requirement factories

comment:14 Changed 8 years ago by ibboard

In [957]:

Re #351: Add extensible requirement handling method

  • Swap to using IRequirement, as per interface
  • Test registration of factories

comment:15 Changed 8 years ago by ibboard

In [958]:

Re #351: Add extensible requirement handling method

  • Move to using registered requirement factories

comment:16 Changed 8 years ago by ibboard

Resolution: fixed
Status: acceptedclosed

In [959]:

Fixes #351: Add extensible requirement handling method

  • Register requirement factory for the tests
Note: See TracTickets for help on using tickets.