#97 closed enhancement (fixed)
Add default points for an army to the GameSystem
Reported by: | ibboard | Owned by: | Henri |
---|---|---|---|
Priority: | major | Milestone: | WarFoundry API 0.2 |
Component: | WarFoundry-API | Version: | Unknown or N/A |
Keywords: | papercut | Cc: | |
Blocked By: | Blocking: | #98 |
Description
As discussed here it might be useful to have GameSystems defining a default army size as different systems have different norms. This should default to a sensible value (e.g. 1000) if the value isn't specified in the file.
Change History (16)
comment:1 Changed 11 years ago by
Blocking: | 98 added |
---|
comment:2 Changed 10 years ago by
Milestone: | WarFoundry 0.1 → WarFoundry 0.2 |
---|
comment:3 Changed 10 years ago by
Blocking: | 57 added |
---|
comment:4 Changed 10 years ago by
Status: | new → confirmed |
---|
Move tickets to new "confirmed" status to show that they've been checked
comment:5 Changed 10 years ago by
Keywords: | papercut added |
---|---|
released: | → no |
Version: | → Unknown or N/A |
comment:6 Changed 9 years ago by
Owner: | set to Henri |
---|---|
Status: | confirmed → accepted |
comment:7 Changed 9 years ago by
I have sort of (again) figured this out. It basically works,trying to hash out a few things with some funny crashes and stuff.
Having a rather interesting snafu as a string can be tested for null but a int can not?
If I do the defaultArmySize as a string it will load the game systems even without the attribute but crashes if picking anything else than the default sample system. Odd.
comment:8 Changed 9 years ago by
Sorry, was ill on Thursday and Friday then busy Christmas shopping yesterday - I didn't mean to leave you hanging :)
"int" can't be tested for null because it can't be null. int (like float, double, boolean, byte and some others) are what are called "primative" types and have to have a value. "string" looks like a primitive (it is lower-case and is normally coloured the same) but is really an alias for String and so is a complex object that can be null.
I'd recommend adding a DefaultSize (or DefaultArmySize or similar) property to the Race class that is of type "int" (or possibly double - are we likely to encounter systems with total values that need to work to halves?) and a matching defaultSize attribute to the <race> tag in the XML schema and define its type as "xs:positiveInteger" with a sensible default for all of the data files that don't define it.
If you need any pointers then just drop me an email or post on the forums. The default names and existing properties that have numeric values might also help as reference.
comment:9 Changed 9 years ago by
I was putting the defaultArmySize in the system file actually. That made sense to me it being a system default after all. Or do you mean in addition to that?
Everything is working pretty ok but it won't load system files that lack the defaultArmySize attribute.
I must admit I wasn't thinking we'd need halfsies, but to be honest you never know.
comment:10 Changed 9 years ago by
Ah, good point. You're correct. We could do per-race as an override as well, but that'd be more code.
In terms of it not loading old files then you need a "default" attribute in the schema so that it sets a default value when accessed correctly (e.g. basePoints uses a default value of 0 and the XMLTools call uses the default in the schema if no value is set/the attribute is missing)
comment:12 Changed 9 years ago by
Status: | accepted → needinfo |
---|
Commit went to default army size branch. Can you merge it IBBoard? I didn't dare to, since there were apparently "issues" with merging branches and whatnot.
comment:15 Changed 9 years ago by
Milestone: | WarFoundry 0.2 → WarFoundry API 0.2 |
---|
Separate API milestone from UI milestone
comment:16 Changed 9 years ago by
Blocking: | 57 removed |
---|
(In #57) Ticket doesn't make sense any more - we're defining the spec as we go and relying on backward/forward compatibility so there is no "complete" to load.
Move some tickets to v0.2 milestone