//alters the calling worldstate to be updated according to it's actor public void generateWorldState (AIActor _goapActor) { //fetch the troct info from the game manager topology = GameManager.instance.allTrocts; //scan for enemies and allies within sight range enemyData = EnemyScan(_goapActor, new List<EnemyPosition> (), new List<ActorBase> ()); //Go into actor and get current troct selfTroct = _goapActor.currentTrOct.GetComponent<TruncOct>(); //go into actor and get the current facing selfFacing = _goapActor.currentFacing; allies = TeamManager.instance.GetTeam(_goapActor.Team); }
private List<TruncOct> TroctsInDirection(List<TruncOct> _troctsInLine, int _facing, TruncOct _rootTroct, GoapWorldstate _worldState) { //see if the facing is connected if (_rootTroct.connections[_facing] != TruncOct.connectionState.Connected) { return _troctsInLine; } else //there is a connection { TruncOct newTroct = _worldState.topology[_rootTroct.connectionObjects[_facing]].GetComponent<TruncOct>(); _troctsInLine.Add(newTroct); _troctsInLine = (TroctsInDirection(_troctsInLine, _facing, newTroct, _worldState)); } return _troctsInLine; }