public static bool isTF(EntityEx entity) { if (entity.cityentity_id.Equals("P_MultiAge_Expedition16b") || entity.cityentity_id.Equals("P_MultiAge_Expedition16")) { return(true); } else { return(false); } }
public static EntityEx CopyFrom(JToken other) { EntityEx ex = new EntityEx { id = other["id"] != null ? other["id"].ToObject <int>() : -1, player_id = other["player_id"] != null ? other["player_id"].ToObject <int>() : -1, cityentity_id = other["cityentity_id"] != null ? other["cityentity_id"].ToString() : "", type = other["type"] != null ? other["type"].ToString() : "", x = other["x"] != null ? other["x"].ToObject <int>() : -1, y = other["y"] != null ? other["y"].ToObject <int>() : -1, connected = other["connected"] != null ? other["connected"].ToObject <int>() : -1, state = other["state"] ?? null, level = other["level"] != null ? other["level"].ToObject <int>() : -1, unitSlots = other["unitSlots"] ?? null, max_level = other["max_level"] != null ? other["max_level"].ToObject <int>() : -1, bonus = other["bonus"] ?? null, }; return(ex); }
public static bool hasSupplyProdAt(this EntityEx entity, ProductionOption option) { if (entity.available_products != null) { if (entity.available_products[option.id] != null) { if (entity.available_products[option.id].product != null) { if (entity.available_products[option.id].product.resources != null) { if (((JObject)entity.available_products[option.id].product.resources).GetValue("supplies") != null) { return(true); } } } } } return(false); }