Ticket #359 (accepted enhancement)

Opened 8 months ago

Last modified 5 weeks ago

Add "only contained" attribute to unit types

Reported by: ibboard Owned by: ibboard
Priority: major Milestone: WarFoundry API 0.2
Component: WarFoundry-API Version: Unknown or N/A
Keywords: containership unittype Cc:
Blocked By: Blocking: #360

Description (last modified by ibboard) (diff)

Currently, all units show up at the top level for the categories they are in. This works for now, but when we get the containership UI in place then we'll have units (e.g. champions) that are contained and don't have an existence in their own right. For these units we need to declare their unit type as "only contained".

This attribute should:

  • Stop units showing in a "get unit types for category" call
  • Be ignored for a "get all unit types for category" call
  • Be loaded from data files
  • Make the unit be deleted when its parent is deleted

Change History

comment:1 Changed 7 months ago by ibboard

  • Status changed from new to confirmed

comment:2 Changed 5 weeks ago by ibboard

  • Owner set to ibboard
  • Status changed from confirmed to accepted

comment:3 Changed 5 weeks ago by ibboard

  • Description modified (diff)

comment:4 Changed 5 weeks ago by IBBoard <dev@…>

In 95c1b68a600b0be8f767b57550dc0b319a02f98a/IBBoard.WarFoundry.API:

Re #359: Add "only contained" attribute to unit types

  • Exclude "contained only" units from Race's list of available units

comment:5 Changed 5 weeks ago by IBBoard <dev@…>

In 2ba1f24eb427bb77ec07f6a09177c96ade1dce74/IBBoard.WarFoundry.API:

Re #359: Add "only contained" attribute to unit types

  • Add attribute to schema and load in factory

Also:

  • Reformat line endings to be consistent

comment:6 Changed 5 weeks ago by IBBoard <dev@…>

In 426b8c5e283c87b6ba29afb83baf3fd5a11869e8/IBBoard.WarFoundry.API:

Re #359: Add "only contained" attribute to unit types

  • Update example army to use "only contained" attribute on champions

comment:7 Changed 5 weeks ago by IBBoard <dev@…>

In 49480e1a8f90b4b291b9f153c40c40a592b98985/IBBoard.WarFoundry.API.Tests:

Re #359: Add "only contained" attribute to unit types

  • Add tests to make sure contained units aren't returned in list for category

comment:8 Changed 5 weeks ago by IBBoard <dev@…>

In c6313a2c08a2367f88ab025b0d670e3ce90e443c/IBBoard.WarFoundry.API.Tests:

Re #359: Add "only contained" attribute to unit types

  • Add missing class
  • Add tests for loading files and test data

comment:9 Changed 5 weeks ago by ibboard

  • Blocking 360 added

(In #360) TODO: Handle nested units in army tree

comment:10 Changed 5 weeks ago by ibboard

TODO: Make changes to Army so that army tree widgets can do nesting properly.

comment:11 Changed 5 weeks ago by ibboard

Also TODO: Make deleted units get removed from their parent.

comment:12 Changed 5 weeks ago by IBBoard <dev@…>

In 0a20688977934d875584b29767182f26bcb9fff6/IBBoard.WarFoundry.API:

Re #359: Add "only contained" attribute to unit types

  • Add "main units" methods to get only top-level units
  • Add nesting to unit creation command

comment:13 Changed 5 weeks ago by IBBoard <dev@…>

In e6c93ceba1197a81acce1f8dccecb3cbadd95f98/IBBoard.WarFoundry.API:

Re #359: Add "only contained" attribute to unit types

  • Make sure we add and remove from the parent unit appropriately
  • Make sure that setting the unit's parent to null removes it from the parent

comment:14 Changed 5 weeks ago by IBBoard <dev@…>

In 0d032c04210edbe61db04fc94efb1b71a417bec6/IBBoard.WarFoundry.API:

Re #359: Add "only contained" attribute to unit types

  • Make sure remove handles sub-units as well

Note: warning the user that the unit has sub-units rather than just removing them is left to the UI

comment:15 Changed 5 weeks ago by IBBoard <dev@…>

In 763ce93f1bfb2caf4f16bbc1217766b044290ef2/IBBoard.WarFoundry.API.Tests:

Re #359: Add "only contained" attribute to unit types

  • Add tests for "main units" methods not getting nested units

comment:16 Changed 5 weeks ago by IBBoard <dev@…>

In d8cd6b259a9f32c5c61991ccf79bcf9edfac6201/IBBoard.WarFoundry.API.Tests:

Re #359: Add "only contained" attribute to unit types

  • Test to make sure sub-units are removed from the army

comment:17 Changed 5 weeks ago by ibboard

Should all be handled now. Leaving the ticket open until user testing is done.

Note: See TracTickets for help on using tickets.