Exemplo n.º 1
0
        public void DoAction(Block block)
        {
            GameLevel level = block.BlockType.Owner;

            if ("RandomBasic".Equals(NewTypeName))
            {
                int number = randomGenerator.Next(0, 3);
                switch (number)
                {
                case 0:
                    level.ChangleBlockType(block, "YellowBasic");
                    break;

                case 1:
                    level.ChangleBlockType(block, "GreenBasic");
                    break;

                case 2:
                    level.ChangleBlockType(block, "BlueBasic");
                    break;
                }
            }
            else
            {
                level.ChangleBlockType(block, NewTypeName);
            }
        }