Exemple #1
0
        public override Unit Clone()
        {
            Unit unit = new Zealot();

            unit.Init(Name, Lev, Hp, Attk, Def);
            return(unit);
        }
Exemple #2
0
        internal Unit Recruit(int idx)
        {
            Unit unit = null;

            switch (idx)
            {
            case 0:
                unit = new Marine();
                break;

            case 1:
                unit = new Tank();
                break;

            case 2:
                unit = new Zealot();
                break;
            }
            if (idx >= 0 && idx < prototypes.Count)
            {
                return(prototypes[idx].Clone());
            }
            return(null);
        }