private Bitmap GenerateMissionSpots(IRequest request) { //-------- kick brute force fill in const int fieldTerminalTargetAmount = 2500; const int switchTargetAmount = 2500; const int kioskTargetAmount = 2500; const int itemSupplyTargetAmount = 2500; const int randomPointTargetAmount = 2500; //----code Db.Query().CommandText("delete missionspotinfo where zoneid=@zoneId").SetParameter("@zoneId", _zone.Id).ExecuteNonQuery(); var staticObjects = MissionSpot.GetStaticObjectsFromZone(_zone); var spotInfos = new List <MissionSpot>(); PlaceOneType(spotInfos, MissionSpotType.fieldterminal, fieldTerminalTargetAmount, fieldTerminalDistanceInfos, staticObjects, fieldTerminalAccuracy); PlaceOneType(spotInfos, MissionSpotType.mswitch, switchTargetAmount, switchDistanceInfos, staticObjects, structureAccuracy); PlaceOneType(spotInfos, MissionSpotType.kiosk, kioskTargetAmount, kioskDistanceInfos, staticObjects, structureAccuracy); PlaceOneType(spotInfos, MissionSpotType.itemsupply, itemSupplyTargetAmount, itemSupplyDistanceInfos, staticObjects, structureAccuracy); PlaceOneType(spotInfos, MissionSpotType.randompoint, randomPointTargetAmount, randomPointDistanceInfos, staticObjects, randomPointAccuracy); var resultBitmap = DrawResultOnBitmap(spotInfos, staticObjects); SendDrawFunctionFinished(request); return(resultBitmap); }
private Bitmap DisplaySpots() { var staticObjects = MissionSpot.GetStaticObjectsFromZone(_zone); var spotInfos = MissionSpot.GetMissionSpotsFromUnitsOnZone(_zone); var randomPointsInfos = MissionSpot.GetRandomPointSpotsFromTargets(_zone.Configuration); spotInfos.AddRange(randomPointsInfos); return(DrawResultOnBitmap(spotInfos, staticObjects)); }
private Bitmap GenerateRandomPointsOnly(IRequest request) { //-------- kick brute force fill in const int randomPointTargetAmount = 2500; //----code var deletedSpots = Db.Query().CommandText("delete missionspotinfo where zoneid=@zoneId and type=@spotType") .SetParameter("@zoneId", _zone.Id) .SetParameter("@spotType", (int)MissionSpotType.randompoint) .ExecuteNonQuery(); Logger.Info(deletedSpots + " random point spots were deleted from zone:" + _zone.Id); var staticObjects = MissionSpot.GetStaticObjectsFromZone(_zone); var spotInfos = MissionSpot.GetMissionSpotsFromUnitsOnZone(_zone); PlaceOneType(spotInfos, MissionSpotType.randompoint, randomPointTargetAmount, randomPointDistanceInfos, staticObjects, randomPointAccuracy); var resultBitmap = DrawResultOnBitmap(spotInfos, staticObjects); SendDrawFunctionFinished(request); var randomPoints = spotInfos.Where(i => i.type == MissionSpotType.randompoint).ToList(); Logger.Info(randomPoints.Count + " new random points were generated."); //------- var deletedTargets = Db.Query().CommandText("delete missiontargets where targetpositionzone=@zoneId and targettype=@targetType") .SetParameter("@zoneId", _zone.Id) .SetParameter("@targetType", (int)MissionTargetType.rnd_point) .ExecuteNonQuery(); Logger.Info(deletedTargets + " mission targets were deleted."); foreach (var missionSpot in randomPoints) { MissionHelper.PlaceRandomPoint(_zone, missionSpot.position, (int)DistanceConstants.MISSION_RANDOM_POINT_FINDRADIUS_DEFAULT); } Logger.Info("new mission targets inserted"); return(resultBitmap); }