1) Property “overriding”
I have a prototype called BasicUnit which is the “foundation” of any piece which needs to be placed on the board.
It handles some actions triggered by the map “end of the movement” key command, and it has a Calculated Property called FinalDestination made like this:
(LocationName.contains(“Battlefield”)) ? “Play” :
(LocationName==“DiscardArea” ) ? (Owner!=0 ? “Discard” : “DoNothing” ) :
(LocationName==“P1 Dashboard” ) ? (Owner==0 ? “AssignToP1” : (Owner==1 ? “DoNothing”:“GoBack”) ):
(LocationName==“P2 Dashboard” ) ? (Owner==0 ? “AssignToP2” : (Owner==2 ? “DoNothing”:“GoBack”) ):
“GoBack”
Finally, there’s some Trigger Action traits where FinalDestination is the condition to trigger when the map KeyCommand is fired.
Now, some piece (or some other prototype which includes BasicUnit) may want to add more tests to FinalDestination, and my approach has been to “override” the property, writing a new one with more different results.
So far it works, but i’m worried if it is a bad pratice, if this pratice results in FinalDestination being calculated more times than what’s needed, and wondering how the traits (and prototype) stacking works on properties with the same name.
Could someone teach me and answer to my concerns?
2) Calculated Property “series”
I want to show some little icons when a unit gains some temporary trait from a series of condition; as example: if the unit is active (a couple of Dynamic Properties must have the right value), is an Infantry (a Marker) and isn’t engaged (a Dynamic Property) with an enemy, it can CounterAttack (this is just an example, a lot of what i need requires a longer “serie” of conditions).
My first istinct is to create “basic” Calculated Properties like IsActive, IsEngaged, IsInfantry, and then use these in all the other “HighLevel” Calculated Properties that needs to use them (so, the CanCounterAttack property would be (IsActive && IsInfantry && !IsEngaged)?1:0
What i’m asking for is how much “inefficient” this method could be in comparison to avoid the “basic” properties and just use the same expressions over and over in every “HighLevel” property i need.
From the maineinance point of view i would like so much to use the “basic” ones: when i change something i just have to alter one property instead of modify all the prototypes/pieces affected by the change, but i’m unable to evaluate if, and how much, this will impact performances.
Thanks





