Пример #1
0
        public SoldierData(TroopData troop, int _line, int _row)
        {
            line       = _line;
            row        = _row;
            type       = troop.type;
            state      = troop.state;
            isAtkTroop = troop.isAtkTroop;
            float dline = troop.line / 2.0f - 0.5f;
            float drow  = troop.row / 2.0f - 0.5f;

            TroopHelper.GetTroopLRSpace(troop.type, out lineSpace, out rowSpace);
            x = (dline - line) * lineSpace;
            y = (row - drow) * rowSpace;
        }
Пример #2
0
        public string mOperators; //指令(预留)

        public void Init()
        {
            RandHelper rand = new RandHelper(1);

            mBattleKey    = "test";
            mCurrentFrame = 1;
            mFinishFrame  = 10000;
            mAtcTroopList = new List <TroopData>();
            mDefTroopList = new List <TroopData>();
            mAllTroopDic  = new Dictionary <uint, TroopData>();
            int atkCount = 30;

            for (int i = 0; i < atkCount; i++)
            {
                TroopData troop = new TroopData();
                troop.count      = 100;
                troop.isAtkTroop = true;
                troop.key        = (uint)i + 1;
                troop.type       = (SoldierType)rand.Random(4);
                troop.x          = i * 100;
                troop.y          = 100;
                troop.line       = 3;
                troop.row        = 2;
                mAtcTroopList.Add(troop);
                mAllTroopDic.Add(troop.key, troop);
            }
            int defCount = 30;

            for (int i = 0; i < defCount; i++)
            {
                TroopData troop = new TroopData();
                troop.count      = 100;
                troop.isAtkTroop = false;
                troop.key        = (uint)i + 100;
                troop.type       = (SoldierType)rand.Random(4);
                troop.x          = i * 100;
                troop.y          = -100;
                troop.line       = 3;
                troop.row        = 2;
                mDefTroopList.Add(troop);
                mAllTroopDic.Add(troop.key, troop);
            }
        }