Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#153 closed enhancement (released)

Default name for armies

Reported by: ibboard Owned by: Henri
Priority: minor Milestone: WarFoundry 0.1
Component: WarFoundry-GUIs Version: Unknown or N/A
Keywords: army name default papercut Cc:
Blocked By: Blocking:

Description

Apparently users like Snowblizz may feel lazy/unimaginative and want the app to name their army for them. This would be a GUI change rather than an API change.

Change History (16)

comment:1 Changed 10 years ago by ibboard

Snowblizz's suggestion is to use "[Race name] Army ([points value])" or to extend races to define what a default army size is (e.g. "Host" for Elves, "Throng" for Dwarves, etc).

comment:2 Changed 10 years ago by ibboard

Status: newconfirmed

Move tickets to new "confirmed" status to show that they've been checked

comment:3 Changed 10 years ago by ibboard

Milestone: WarFoundry 0.2

comment:4 Changed 10 years ago by ibboard

Keywords: papercut added
released: no
Version: Unknown or N/A

comment:5 Changed 9 years ago by Henri

Owner: set to Henri
Status: confirmedaccepted

comment:6 Changed 9 years ago by Henri

I've been looking at this since you note it is a GUI thing and I've managed to get a simple version working. Ie just taking the race name + army, and getting the point value.

I am however curious, if I wanted to use a "name" pulled from the datafile would there be any more involved changes, I can figure out so much that the schema needs to include the new attribute, but it does also require changes to the Warfoundry.API, yes? I've managed to track down the Warfoundry.Objects.Races but I can quite fathom how it all fits together.

comment:7 Changed 9 years ago by ibboard

To pull a basic name you'll need to add a few bits to the API:

1) Add a property to the Race object ("DefaultArmyName" or something sensible) with a setter, a getter and a variable behind it
2) Add a definition to the schema (an attribute on the <race> tag is probably most appropriate)
3) Add the loading of the value to the WarFoundryXmlRaceFactory - we can have multiple factories, but XML is the main one for now and it just parses the XML file and creates the necessary objects.
4) Add some tests in the IBBoard.WarFoundry.API.Tests project to make sure that it validates and loads correctly, and fails if you give it an invalid value.

As a future extension, we could make this fall back to the game system if nothing is defined at the race level and let the race name be used (e.g. "{0} horde" would become "Dwarf Horde" "Human Horde" etc).

If you want any more suggestions and pointers, just start a topic on the forums :)

comment:8 Changed 9 years ago by Henri

(In r674) Re #153: Default name for armies
Been messing a round with the code a bit

comment:9 Changed 9 years ago by Henri

(In r676) Re #153: Default name for armies
Hopefully API code added as well

comment:10 Changed 9 years ago by Henri

(In r677) Re #153: Default name for armies
Now it reads the data from the race file but changes everything in the list instead?!?
Well I guess this was a nice little program until I broken it. My bad.

comment:11 Changed 9 years ago by ibboard

(In r678) Re #153: Default name for armies

  • Add explicit default value in schema
  • Swap adding of extra constructor parameter (which wasn't stored at any point) to using property
  • Clean up line endings

comment:12 Changed 9 years ago by ibboard

(In r679) Re #153: Default name for armies

  • Have a fight between VS.Net versions over how to reference projects (may need to update from 2K3 but still target .Net 2)
  • Use property of race object and clean up comments

comment:13 Changed 9 years ago by ibboard

(In r680) Re #153: Default name for armies

  • Do a bit of string formatting to allow "{0} Empire Army" to become "2000pt Empire Army"

comment:14 Changed 9 years ago by ibboard

Resolution: fixed
Status: acceptedclosed

(In r681) Fixes #153: Default name for armies

  • Merge back in to Trunk

comment:15 Changed 9 years ago by ibboard

Resolution: fixedreleased

Mark fix as released under 0.1RC2

comment:16 Changed 9 years ago by ibboard

Milestone: WarFoundry 0.2WarFoundry 0.1
Note: See TracTickets for help on using tickets.