Example #1
0
 public ActorFactory(
     ActorSettings settings,
     IActorStatuses statuses,
     Vector2Int startPosition)
 {
     _settings      = settings;
     _statuses      = statuses;
     _startPosition = startPosition;
 }
Example #2
0
 public ActorModel(
     Vector2Int startPosition,
     ActorStates states,
     IActorStatuses statuses,
     LevelState levelState)
 {
     StartPosition = startPosition;
     Position      = startPosition;
     States        = states;
     Statuses      = statuses;
     LevelState    = levelState;
 }
Example #3
0
        public void SetUp()
        {
            _board            = Resources.Load <Board>("TestActor/TestBoard");
            _actorSettings    = Resources.Load <ActorSettings>("TestActor/TestActorSettings");
            _actorStatuses    = new TestActorStatuses();
            _actorBrain       = Resources.Load <ActorBrainSpy>("TestActor/TestActorBrainSpy");
            _blockerSettings  = Resources.Load <ActorSettings>("TestActor/TestBlockerSettings");
            _pushableSettings = Resources.Load <ActorSettings>("TestActor/TestPushableSettings");

            var levelState = Resources.Load <LevelState>("TestActor/TestLevelState");

            levelState.Initialise(new ObservableStateBroker());
            levelState.GameplayState.Value = LevelState.GameplayStates.Playing;
        }
        public PushState Interact(IActorStatuses statuses, Vector2Int direction)
        {
            if (!_settings.Pushable)
            {
                return(PushState.Static);
            }

            var movePosition = _model.Position + direction;

            if (_settings.Board.HasWallAt(movePosition))
            {
                return(PushState.Blocked);
            }

            var actor = _settings.Board.Get(movePosition);

            if (actor == null)
            {
                return(PushState.Pushable);
            }

            return(actor.Interact(_model.Statuses, direction));
        }
 public PushState Interact(IActorStatuses statuses, Vector2Int direction) => _interactHandler.Interact(statuses, direction);
Example #6
0
 public PushState Interact(IActorStatuses actorStatuses, Vector2Int direction) => _controller.Interact(actorStatuses, direction);