示例#1
0
        static void Main(string[] args)
        {
            Knight knight = new Knight();
            Mage   mage   = new Mage();

            EnterGame(mage);
        }
示例#2
0
        static void Main(string[] args)
        {
            Knight knight = new Knight();
            Mage   mage   = new Mage();

            knight.Move();
            mage.Move();
        }
示例#3
0
        static void EnterGame(Player player)
        {
            player.Move();

            Mage mage = (player as Mage);

            if (mage != null)
            {
                mage.mp = 10;
            }
        }
示例#4
0
        static void EnterGame(Player player)
        {
            Mage mage = (player as Mage);

            if (mage != null)
            {
                mage.mp = 10;
                mage.Move();
            }

            Knight knight = (player as Knight);

            if (mage != null)
            {
                knight.Move();
            }
        }