public static bool HexIsOpenAndReachable(Hex current, Hex end, Dictionary <Hex, bool> mapValues) { bool reachable = UpdateReachableHexListSystem.IsReachable(current, end); bool free = HexIsOpen(end, mapValues); //Debug.Log($"the hex is free:{free} and reachable:{reachable}"); return(reachable && free); }
protected override void OnCreate() { inputSystem = World.GetOrCreateSystem <InputSystem>(); selectionSystem = World.GetOrCreateSystem <SelectionSystem>(); lockstepSystemGroup = World.GetOrCreateSystem <LockstepSystemGroup>(); lockstepSystemGroup.AddSystemToUpdateList(World.GetOrCreateSystem <CommandExecutionSystem>()); lockstepSystemGroup.AddSystemToUpdateList(World.GetOrCreateSystem <VolatileCommandSystem>()); lockstepSystemGroup.AddSystemToUpdateList(World.GetOrCreateSystem <CommandableSafetySystem>()); blockMovementSystem = World.GetOrCreateSystem <BlockMovementSystem>(); onGroupCheckSystem = World.GetOrCreateSystem <OnGroupCheckSystem>(); updateReachableHexListSystem = World.GetOrCreateSystem <UpdateReachableHexListSystem>(); resourceSourceManagerSystem = World.GetOrCreateSystem <ResourceSourceManagerSystem>(); triggerGatherSystem = World.GetOrCreateSystem <TriggerGatherSystem>(); dropPointSystem = World.GetOrCreateSystem <DropPointSystem>(); triggerUpdateResBufferSystem = World.GetOrCreateSystem <TriggerUpdateResBufferSystem>(); updateResourceBufferSystem = World.GetOrCreateSystem <UpdateResourceBufferSystem>(); updateOcupationMapSystem = World.GetOrCreateSystem <UpdateOcupationMapSystem>(); updateDestinationSystem = World.GetOrCreateSystem <UpdateDestinationSystem>(); sightSystem = World.GetOrCreateSystem <SightSystem>(); pathRefreshSystem = World.GetOrCreateSystem <PathRefreshSystem>(); pathFindingSystem = World.GetOrCreateSystem <PathFindingSystem>(); pathChangeIndexSystem = World.GetOrCreateSystem <PathChangeIndexSystem>(); findPosibleTargetsSystem = World.GetOrCreateSystem <FindPosibleTargetsSystem>(); findActionTargetSystem = World.GetOrCreateSystem <FindActionTargetSystem>(); findMovementTargetSystem = World.GetOrCreateSystem <FindMovementTargetSystem>(); steeringSystem = World.GetOrCreateSystem <SteeringSystem>(); translationSystem = World.GetOrCreateSystem <TranslationSystem>(); movementFinisherSystem = World.GetOrCreateSystem <MovementFinisherSystem>(); collisionSystem = World.GetOrCreateSystem <CollisionSystem>(); directionSystem = World.GetOrCreateSystem <DirectionSystem>(); startActSystem = World.GetOrCreateSystem <StartActSystem>(); removeReceivingActComponentsSystem = World.GetOrCreateSystem <RemoveReceivingActComponentsSystem>(); initReceivingActComponentsSystem = World.GetOrCreateSystem <InitReceivingActComponentsSystem>(); attackSystem = World.GetOrCreateSystem <AttackSystem>(); receiveDamageSystem = World.GetOrCreateSystem <ReceiveDamageSystem>(); gatherSystem = World.GetOrCreateSystem <GatherSystem>(); extractResourceSystem = World.GetOrCreateSystem <ExtractResourceSystem>(); updateGathererAmmountSystem = World.GetOrCreateSystem <UpdateGathererAmmountSystem>(); endActionSystem = World.GetOrCreateSystem <EndActionSystem>(); resourceSystem = World.GetOrCreateSystem <ResourceSystem>(); deathSystem = World.GetOrCreateSystem <DeathSystem>(); //simulationSystemGroup = World.GetOrCreateSystem<SimulationSystemGroup>(); //simulationSystemGroup.AddSystemToUpdateList(World.GetOrCreateSystem<PathFindingSystem>()); //simulationSystemGroup.AddSystemToUpdateList(World.GetOrCreateSystem<PathFollowSystem>()); //lateSimulationSystemGroup = World.GetOrCreateSystem<LateSimulationSystemGroup>(); //applicationSystemGroup = World.GetOrCreateSystem<ApplicationSystemGroup>(); }