ConsoleUI/GamePlayground.cs

(开头部分) 8KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

namespace ConsoleUI
{
    using System;
    using System.Collections.Generic;
    using SuperMario;
    using SuperMario.Bonuses;
    using SuperMario.Bonuses.Coins;
    using SuperMario.Characters;
    using SuperMario.Characters.Enemies;
    using SuperMario.Characters.Players;
    
    /// <summary>
    /// Draws game's playground with all needed elements. With default parameters.
    /// </summary>
    class GamePlayground
    {
        private const int NUMBER_OF_ENEMIES = 4;
        private const int NUMBER_OF_GOLD_COINS = 2;
        private const int NUMBER_OF_SILVER_COINS = 6;
        private const int NUMBER_OF_FLOORS = 4;
        private const int JUMP_MAX_HEIGHT = 2;
        private const int PLAYER_SATRT_POSITION_X = 2;
        private const int PLAYER_SATRT_POSITION_Y = NUMBER_OF_FLOORS;

        public readonly char BRICK = '*';
        public readonly char EXIT = 'E';

        private Character player;
        private IList<Character> enemies;
        private IList<Bonus> bonuses;
        private Map map;

        public GamePlayground()
        {
            this.Player = new Mario(PLAYER_SATRT_POSITION_X, PLAYER_SATRT_POSITION_Y);
            this.Bonuses = GenerateBonuses();
            this.Enemies = GenerateEnemies();
            this.Map = new Map();
            this.Playground = new char[map.Width, map.Height];
            this.DrawPlayground();
        }

        public Character Player
        {
            get
            {
                return this.player;
            }

            private set
            {
                if (value == null)
                {
                    throw new ArgumentNullException("player", "Player can not be null");
                }

                this.player = value;
            }
        }

后面还有 223 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。