public static BaseLevel Generate(bool correct = true)
        {
            var game = new Game();

            var data = new LevelModel()
            {
                Port = new ShipPortModel()
                {
                    Index = 5,
                    Size = 10
                },
                Tracks = new TrackModel[]
                {
                    new TrackModel()
                    {
                        Type = TrackType.Start,
                        Direction = Direction.East,
                        Position = new Vector(0, 0)
                    },
                    new TrackModel()
                    {
                        Type = TrackType.Default,
                        Direction = Direction.East,
                        Position = new Vector((correct ? 1 : 2), 0)
                    }
                }
            };

            var manager = new LevelManager(game);
            return new BaseLevel(manager, data);
        }
Beispiel #2
0
        public BaseLevel(LevelManager manager, LevelModel data)
        {
            if(manager == null)
                throw new ArgumentNullException("manager");
            else if (data == null)
                throw new ArgumentNullException("data");

            _manager = manager;
            _metrics = LevelMetrics.Zero;
            _port = new ShipPort(this, data.Port);
            _tracks = TrackFactory.GetInstance().Create(data);
            _carts = new List<BaseCart>();
            _spawner = new Spawner(this);

            Initialize();
        }
Beispiel #3
0
 private void Initialize()
 {
     _contentManager = new ContentManager(_options.ContentPath, _options.ContentSource);
     _levelManager = new LevelManager(this);
 }