In the JsonMap.json, missiles and buildings have a playerType field, they also have their own x/y coordinates, however these are missing in the Missile and Building classes that are used for de-serialization. This leads to not having access to missile ownership in gameState without modifying the example code.
{"x":4,"y":3,"buildings":[{"health":20,"constructionTimeLeft":1,"price":30,"weaponDamage":0,"weaponSpeed":0,"weaponCooldownTimeLeft":0,"weaponCooldownPeriod":0,"destroyMultiplier":1,"constructionScore":1,"energyGeneratedPerTurn":0,"buildingType":"DEFENSE","x":4,"y":3,"playerType":"B"}],"missiles":[{"damage":5,"speed":1,"x":4,"y":3,"playerType":"B"}],"cellOwner":"B"}
public class Building
{
public int Health { get; set; }
public int ConstructionTimeLeft { get; set; }
public int Price { get; set; }
public int WeaponDamage { get; set; }
public int WeaponSpeed { get; set; }
public int WeaponCooldownTimeLeft { get; set; }
public int WeaponCooldownPeriod { get; set; }
public int DestroyScore { get; set; }
public int EnergyGeneratedPerTurn { get; set; }
public BuildingType BuildingType { get; set; }
}
public class Missile
{
public int Damage { get; set; }
public int Speed { get; set; }
}
The x/y coordinates are also redundant, because the missiles/buildings are already placed inside the corresponding x/y bucket. I also don’t see the point of dumping all the building stats for each building for every instance of that building, all the fields except the cool-downs are constants.