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; }
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; }
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)); }
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(); }
public IdleInputState(InputStateMachine context) : base(context) { _gm = _locator.GetService <IGameManager>(); _map = _locator.GetService <IHexMap>(); }
public SpectateInputState(InputStateMachine context) : base(context) { }