예제 #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();
            }
        }