Esempio n. 1
0
    //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();
    }
Esempio n. 3
0
 void Awake()
 {
     dragonData = Resources.Load <DragonData>(pathToDragonData);
 }
 public override void Start()
 {
     this.gameObject.GetComponent <Animator>().SetBool("run", true);
     data = this.gameObject.GetComponent <DragonData>();
 }
Esempio n. 5
0
 public override void Start()
 {
     data = this.gameObject.GetComponent <DragonData>();
 }
    void readDragon()
    {
        DragonInfo = new DragonData();

        readDragonPlayer();
        readDragonHouse();
        readDragonItem();
        readDragonConfig();
    }