Пример #1
0
    public GameMaker(int rowCount, int rowWidth, int groundFrom, int groundTo, GameObject player,
                     ILevelGenerator levelGenerator, IGameRules gameRules, IWorldCreator worldCreator)
    {
        _rowCount     = rowCount;
        _rowWidth     = rowWidth;
        _groundFrom   = groundFrom;
        _groundTo     = groundTo;
        _worldCreator = worldCreator;
        _player       = player;

        _levelGenerator = levelGenerator;
        _gameRules      = gameRules;

        Debug.Log("New game, GameMaker constructor.");
    }
Пример #2
0
        protected WorldBase(IWorldOptions options, IWorldCreator worldCreator)
        {
            if (worldCreator is null)
            {
                throw new ArgumentNullException(nameof(worldCreator));
            }

            Options = options ?? throw new ArgumentNullException(nameof(options));

            WorldCreator = worldCreator;

            worldCreator.WorldCreated += () => WorldCreated?.Invoke();

            WorldCreated += OnWorldCreated;

            if (Options.CreateWorldOnInstantiate)
            {
                CreateWorld();
            }
        }
Пример #3
0
 public MyWorldBaseImpl(IWorldOptions options, IWorldCreator worldCreator) : base(options, worldCreator)
 {
 }