GetNearestVolunteerCenter() public method

Gets the nearest volunteer center with respect to a specific tile.
public GetNearestVolunteerCenter ( MS3DTile reference ) : MSVolunteerCenter
reference MS3DTile Tile used as a reference point to find the nearest volunteer center
return MSVolunteerCenter
Example #1
0
 public void VolunteerCitizen(MSMap map)
 {
     MS3DTile bldg = map.GetRandomCitizenSource();
     MS3DTile center = map.GetNearestVolunteerCenter(bldg);
     Node path = map.GetPath(bldg.TileCoordinate, center.TileCoordinate);
     MSVolunteeringCitizen v = new MSVolunteeringCitizen(bldg.Position + MSUnit.UNITZ_POSITION, path, map, 0);
     units.Add(v);
 }
Example #2
0
        public void SendWorkers(MSMap map, MSChangeableBuilding bldg, int qty)
        {
            MSVolunteerCenter center = map.GetNearestVolunteerCenter(bldg);
            Node path = map.GetPath(center.TileCoordinate, bldg.TileCoordinate);

            for (int i = 0; i < qty; i++)
            {
                MSWorker worker = new MSWorker(center.Position + MSUnit.UNITZ_POSITION, path, bldg, map, 0);
                units.Add(worker);
            }
        }