Пример #1
0
        public bool Parce(SplitStringData dataSplitString)
        {
            int hp;

            if (dataSplitString.unitType == UnitType)
            {
                if (int.TryParse(dataSplitString.data.GetParamFromString("health"), out hp))
                {
                    new Infantry(hp);
                }
            }
            return(false);
        }
Пример #2
0
        public bool Parce(SplitStringData dataSplitString)
        {
            int hp;
            int mana;

            if (dataSplitString.unitType == UnitType)
            {
                if (int.TryParse(dataSplitString.data.GetParamFromString("health"), out hp) &&
                    int.TryParse(dataSplitString.data.GetParamFromString("mana"), out mana)
                    )
                {
                    new Mage(hp, mana);
                }
            }
            return(false);
        }