예제 #1
0
        // YD: get next waypoint to go to in structure
        internal TerrainService.Vector CalculateNextWaypointPosition(clsGroundAtom refGroundAtom)
        {
            // next point is drawn randomly
            int             numOfWaypointNeighbors = refGroundAtom.currentStructureWaypoint.neighbors.Count();
            PolygonWaypoint nextWaypoint           = refGroundAtom.currentStructureWaypoint.neighbors[Util.random.Next(numOfWaypointNeighbors)];

            targetPosition   = new TerrainService.Vector();
            targetPosition.x = nextWaypoint.x;
            targetPosition.y = nextWaypoint.y;
            refGroundAtom.currentStructureWaypoint = nextWaypoint;
            refGroundAtom.currentAzimuth           = Util.Azimuth2Points(refGroundAtom.curr_X, refGroundAtom.curr_Y,
                                                                         nextWaypoint.x, nextWaypoint.y);
            return(targetPosition);
        }
예제 #2
0
        public override void Enter(clsGroundAtom refGroundAtom)
        {
            refGroundAtom.clearAllEventSubscriptions();
            refGroundAtom.earthquakeEndedEventHandler   += earthquakeEndedInStructureEventHandler;
            refGroundAtom.forcesHaveArrivedEventHandler += forcesHaveArrivedInStructureEventHandler;
            refGroundAtom.currentStructureWaypoint       = Structure.waypointGraph.findClosestWaypoint(refGroundAtom.curr_X, refGroundAtom.curr_Y);
            exitWaypoints = Structure.waypointGraph.findExitPath(refGroundAtom.currentStructureWaypoint);
            PolygonWaypoint exitWaypoint = exitWaypoints[exitWaypoints.Count() - 1];

            exitEdgeNumber   = exitWaypoint.edgeNum;
            targetPosition   = new TerrainService.Vector();
            targetPosition.x = exitWaypoints[waypointIndex].x;
            targetPosition.y = exitWaypoints[waypointIndex].y;
            waypointIndex++;
        }
예제 #3
0
 public REGULAR_MOVEMENT_IN_STRUCTURE_STATE(clsPolygon _Structure, PolygonWaypoint nextWaypoint)
     : base(_Structure)
 {
     this.nextWaypoint = nextWaypoint;
 }
예제 #4
0
 public REGULAR_MOVEMENT_IN_STRUCTURE_STATE(clsPolygon _Structure, PolygonWaypoint nextWaypoint)
     : base(_Structure)
 {
     this.nextWaypoint = nextWaypoint;
 }