Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#279 closed enhancement (released)

Create composite limit

Reported by: ibboard Owned by: ibboard
Priority: major Milestone: WarFoundry 0.1
Component: WarFoundry-API Version: WarFoundry 0.1b8
Keywords: limit equipment Cc:
Blocked By: Blocking:


Some recent discussions highlighted the fact that we might need composite limits (e.g. for equipment) where the limit is a combination of two other limits.

The known use case is where a unit can have one and only one of a certain class of weapon if they are between 5 and 10 models. The "if >= 5" can be handled by a ratio limit of 0.2 rounding down, but that allows 2 for a unit of 10, so we need to combine it with "and an absolute limit of 1".

Change History (9)

comment:1 Changed 10 years ago by ibboard

Status: newconfirmed

comment:2 Changed 10 years ago by ibboard

Owner: set to ibboard
Status: confirmedaccepted

comment:3 Changed 10 years ago by ibboard

IBBoard:#45 is complete, so we can now make use of them.

comment:4 Changed 10 years ago by ibboard

(In r585) Re #279: Create composite limit

  • Change uses of "AbstractLimit" to "ILimit" as composites don't have a number themselves and can't extend AbstractLimit
  • Refactor limit parsing code out into a separate class
  • Use grouping to allow for re-use of limit types in schema
  • Add min and max composite limits in schema

comment:5 Changed 10 years ago by ibboard

(In r586) Re #279: Create composite limit

  • Add first tests for limit parser - composites are parsed, but children aren't picked up by XPath query yet

comment:6 Changed 10 years ago by ibboard

(In r587) Re #279: Create composite limit

  • Ignore XPath and go for all child nodes, since we want to warn in future if an unsupported limit is ignored
  • Make the "any" option in the limit choice group a singular instead of 0+ to ensure we get a choice when we use the group

comment:7 Changed 10 years ago by ibboard

(In r588) Re #279: Create composite limit

  • Create separate tests for min and max limits (rename existing test data file)
  • Fix namespacing of limit nodes
  • Add test for nesting of composite limits
  • Add tests for empty composite causing failure

comment:8 Changed 10 years ago by ibboard

Resolution: fixed
Status: acceptedclosed

Fixed in r588

comment:9 Changed 9 years ago by ibboard

Resolution: fixedreleased

Retro-actively tag RC1 releases as released

Note: See TracTickets for help on using tickets.