Beispiel #1
0
 public HexPickState(InputStateMachine context, IEnumerable <HexTile> pickableTiles, Action <HexTile> pickCallback = null, Action otherCallback = null)
     : base(context)
 {
     _pickableTiles = new HashSet <HexTile>(pickableTiles);
     _pickCallback  = pickCallback;
     _otherCallback = otherCallback;
 }
Beispiel #2
0
        public AbstractInputState(InputStateMachine context)
        {
            Context = context;

            _locator = ServiceLocator.Instance;
            _bus     = _locator.GetService <IMessageBus>();
        }
        public WaitForJobState(InputStateMachine context, IJob job, IInputState targetState)
            : base(context)
        {
            _job             = job;
            _job.OnComplete += OnJobComplete;

            _targetState = targetState;
        }
Beispiel #4
0
        public EntityAttackInputState(InputStateMachine context, Entity entity)
            : base(context)
        {
            Entity           = entity;
            _possibleTargets = new HashSet <Entity>(Entity.AttackableEntitiesInRange());

            _map = _locator.GetService <IHexMap>();
        }
        public EntityMovementInputState(InputStateMachine context, Entity entity)
            : base(context)
        {
            Entity    = entity;
            _moveComp = entity.GetComponent <HexMovementComp>();

            _gm  = _locator.GetService <IGameManager>();
            _map = _locator.GetService <IHexMap>();

            _navField = _map.GetNav(new HexNavSettings(_moveComp.Position, _moveComp.jumpHeight));
        }
Beispiel #6
0
        public TerraformInputState(InputStateMachine context, Card card)
            : base(context)
        {
            _card           = card;
            _terrainChanges = (card.Data as TerraformCardData).GetTerrainChanges();

            _gm  = _locator.GetService <IGameManager>();
            _map = _locator.GetService <IHexMap>();

            var tiles = new HashSet <HexCubeCoord>();

            var gm = _locator.GetService <IGameManager>();

            foreach (var mem in gm.HomeSquad.AliveMembers)
            {
                var pos = mem.GetComponent <HexPosComp>().Position;

                tiles.UnionWith(HexFun.Spiral(pos, 2));
            }

            _pickableTiles = _map.Tiles(tiles).ToList();
        }
Beispiel #7
0
 public IdleInputState(InputStateMachine context)
     : base(context)
 {
     _gm  = _locator.GetService <IGameManager>();
     _map = _locator.GetService <IHexMap>();
 }
Beispiel #8
0
 public SpectateInputState(InputStateMachine context)
     : base(context)
 {
 }