コード例 #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);
    }
コード例 #2
0
    void readDragon()
    {
        DragonInfo = new DragonData();

        readDragonPlayer();
        readDragonHouse();
        readDragonItem();
        readDragonConfig();
    }
コード例 #3
0
 void Awake()
 {
     dragonData = Resources.Load <DragonData>(pathToDragonData);
 }
コード例 #4
0
 public override void Start()
 {
     this.gameObject.GetComponent <Animator>().SetBool("run", true);
     data = this.gameObject.GetComponent <DragonData>();
 }
コード例 #5
0
 public override void Start()
 {
     data = this.gameObject.GetComponent <DragonData>();
 }
コード例 #6
0
    void readDragon()
    {
        DragonInfo = new DragonData();

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