//public int GetNumberOfPeastantsAt(ResourceLocation location) //{ // var peasants = CurrentGameState.ResourceState.Peasants; // return peasants.Count(p => (p.CurrentLocation == location) && (p.IsInTrasit == false)); //} //public IEnumerable<Peasant> GetPeasantsAt(ResourceLocation location) //{ // var peasants = CurrentGameState.ResourceState.Peasants; // return peasants.Where(p => (p.CurrentLocation == location) && (p.IsInTrasit == false)); //} /// <summary> /// Core logic to figh with the dragon /// </summary> /// <param name="dragon"></param> /// <param name=""></param> /// <returns></returns> public bool FightWithDragon(DragonData dragon, int nWeapons, IEnumerable <Peasant> fighters) { var totalFightingForce = CalculateTotalForce(nWeapons, fighters); bool result = totalFightingForce >= dragon.FightingStrength; return(result); }
void readDragon() { DragonInfo = new DragonData(); readDragonPlayer(); readDragonHouse(); readDragonItem(); readDragonConfig(); }
void Awake() { dragonData = Resources.Load <DragonData>(pathToDragonData); }
public override void Start() { this.gameObject.GetComponent <Animator>().SetBool("run", true); data = this.gameObject.GetComponent <DragonData>(); }
public override void Start() { data = this.gameObject.GetComponent <DragonData>(); }