Example #1
0
        private void InitPlayerTeam(ref BattleCamp camp)
        {
            PlayerData        playerData  = Consts.D_PLAYER.GetData <PlayerData>();
            List <HeroFields> playerHeros = playerData.Heros.GetTeamHeros();

            int n   = playerHeros.Count;
            int max = Consts.CAMP_HERO_MAX;

            for (int i = 0; i < max; i++)
            {
                HeroFields copy = new HeroFields();
                if (i < n)
                {
                    HeroFields hero = playerHeros[i];
                    hero.CopyToFields(ref copy);

                    BattleHeroController heroContorller = new BattleHeroController(copy);
                    camp.SetCampHero(i, heroContorller);
                }
                else
                {
                }
            }

            BattleFields battleFields = camp.BattleInfoController.Info;
            int          troops       = battleFields.GetIntData(Consts.FN_TROOPS);
            int          troopsMax    = battleFields.GetIntData(Consts.FN_TROOPS_MAX);

            "log:Player troops is {0}/{1}".Log(troops.ToString(), troopsMax.ToString());
            "log:Player intelligential is {0}".Log(battleFields.GetFloatData(Consts.FN_INTELLIGENTIAL).ToString());
            "log:Player intelligential delta is {0}".Log(battleFields.GetFloatData(Consts.FN_INTELLIGENTIAL_DELTA).ToString());
        }
        public void AddHero(int sid, ref HeroItem item)
        {
            HeroFields heroFields = new HeroFields();

            heroFields.InitFormItem(ref item);
            mHeros[sid] = heroFields;

            //先直接放入队伍
            mTeamHeros.Add(heroFields);
        }
Example #3
0
        public override void FillFromDataRaw(ref string source)
        {
            JsonData jsonData = JsonMapper.ToObject(source);

            HeroItem data;
            JsonData item;
            int      count = jsonData.Count;

            for (int i = 0; i < count; i++)
            {
                item = jsonData[i];

                HeroFields.FillFromJSON(ref item, out data);

                m_Collections.Add(data);
            }
        }
Example #4
0
 public void CopyToFields(ref HeroFields heroFields)
 {
     heroFields?.InitFormItem(ref mHeroItem);
 }