public void DisprovedConstructorWithForeignCardTest() { Player disprovingPlayer = new Player("opponent"); Suspicion suggestion = new Suspicion(new Suspect("test"), new Weapon("test"), new Place("test")); Card cardShown = new Suspect("some other suspect"); new Disproved(disprovingPlayer, suggestion, cardShown); }
public void GetContraintsMissingNodesTest() { Player playerShowingCard = new Player("test"); Card cardSeen = new Weapon("test"); Card anotherCard = new Suspect("test"); Node[] nodes = new Node[] { new Node(playerShowingCard, cardSeen), new Node(playerShowingCard, anotherCard), }; new SpyCard(playerShowingCard, cardSeen).GetConstraints(nodes.Where((n, i) => i == 1)).Count(); }
public void CardsTest() { var w = new Weapon("weapon"); var s = new Suspect("suspect"); var l = new Place("location"); Suspicion target = new Suspicion(s, w, l); List<Card> cards = target.Cards.ToList(); CollectionAssert.Contains(cards, w); CollectionAssert.Contains(cards, s); CollectionAssert.Contains(cards, l); Assert.AreEqual(3, cards.Count); }
/// <summary> /// Initializes a new instance of the <see cref="Suspicion"/> class. /// </summary> /// <param name="suspect">The suspect.</param> /// <param name="weapon">The weapon.</param> /// <param name="place">The place.</param> public Suspicion(Suspect suspect, Weapon weapon, Place place) { Contract.Requires<ArgumentNullException>(suspect != null, "suspect"); Contract.Requires<ArgumentNullException>(weapon != null, "weapon"); Contract.Requires<ArgumentNullException>(place != null, "place"); this.suspect = suspect; this.weapon = weapon; this.place = place; Contract.Assume(this.Cards.Count() == 3); }
public static Suspect FirstAfter(this Suspect[] suspects, Suspect startAfter, Func <Suspect, bool> predicate) { var ix = (suspects.IndexOf(startAfter) + 1) % suspects.Length; for (int i = 0; i < suspects.Length; i++) { var thisOne = suspects[(i + ix) % suspects.Length]; if (predicate(thisOne)) { return(thisOne); } } return(suspects[ix]); }
public override bool OnCalloutAccepted() { Suspect = NativeFunction.Natives.CREATE_RANDOM_PED <Ped>(SpawnPoint.X, SpawnPoint.Y, SpawnPoint.Z); Suspect.MakeMissionPed(); //SuspectBlip = Suspect.AttachBlip(); SearchArea = new Blip(SearchAreaLocation, 40f); SearchArea.Color = Color.Yellow; SearchArea.Alpha = 0.6f; Game.DisplayNotification("3dtextures", "mpgroundlogo_cops", "Person with a knife", "Dispatch to ~b~" + AssortedCalloutsHandler.DivisionUnitBeat, "We have a ~r~person with a knife. ~b~Locate and arrest them."); CalloutHandler(); return(base.OnCalloutAccepted()); }
// GET: Suspects/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Suspect suspect = db.Suspects .Include(s => s.FilePaths).SingleOrDefault(s => s.SuspectId == id); if (suspect == null) { return(HttpNotFound()); } return(View(suspect)); }
public void Start() { var data = DummyData.GetDummyData(); this.investigator = new Investigator(data); this.investigator.RandomOffender(); this.questions = new string[7]; this.questions[0] = "I know who did it, it was {name}! (repeatable)"; //this.questions[1] = "Is your gender {Gender}? (Male, Female, Unknown)"; this.questions[2] = "Do you have glasses? (True or False)"; //this.questions[3] = "Is your balance higher then {value}?"; //this.questions[4] = "Is your haircollor {haircollor}?"; //this.questions[5] = "Do you ilke to practice {hobby} in your free time?"; this.questions[6] = "Are you older then {age}?"; Suspect offender = null; turnCounter = 0; while (offender == null) { this.PrintResults(); this.PrintOptions(); String input = Console.ReadLine(); this.ProcessInput(input); turnCounter++; if (investigator.Suspects.Count == 1) { offender = investigator.Suspects.First(); } Console.WriteLine("=========== NEXT ROUND ============="); } Console.WriteLine("You found the offender in {1} turns, it was {0}", offender.Name, turnCounter); Console.WriteLine("Would you like to play again? Press Y to play again, or any other key to close this app"); ConsoleKeyInfo key = Console.ReadKey(); if (key.KeyChar == 'y') { Start(); } Environment.Exit(0); }
public void AddSuspect(Suspect newSuspect) { if (!CheckAddedSuspects(newSuspect)) { foundSuspects.Add(newSuspect); gameData.foundSuspects = foundSuspects; // Suspect Analytics Analytics.CustomEvent("FoundSuspect", new Dictionary <string, object> { { "SuspectName", newSuspect.suspectName } }); AutoSave(); RefreshBleepBloop(); } }
public override bool OnCalloutAccepted() { SuspectCar = new Vehicle("STOCKADE", SpawnPoint); SuspectCar.MakePersistent(); new Ped(Vector3.Zero); Suspect.MakeMissionPed(); SuspectBlip = Suspect.AttachBlip(); SuspectBlip.Color = Color.Red; Suspect.Inventory.GiveNewWeapon(new WeaponAsset(firearmsToSelectFrom[AssortedCalloutsHandler.rnd.Next(firearmsToSelectFrom.Length)]), -1, true); Suspect.WarpIntoVehicle(SuspectCar, -1); if (!CalloutRunning) { CalloutHandler(); } return(base.OnCalloutAccepted()); }
public Suspect CreateSuspect(Suspect newSus) { if (newSus.SusDescription == null) { throw new AppException("Description cannot be empty."); } else if (newSus.SusName == null) { throw new AppException("Name cannot be empty."); } else { _dbContext.Suspects.Add(newSus); _dbContext.SaveChanges(); return(newSus); } }
public bool CreateSuspect(SuspectCreate model) { var entity = new Suspect() { Name = model.Name, Height = model.Height, Weight = model.Weight, DateBooked = model.DateBooked, PriorConviction = model.PriorConviction }; using (var ctx = new ApplicationDbContext()) { ctx.Suspects.Add(entity); return(ctx.SaveChanges() == 1); } }
public void Step() { if (--seconds > 0) { var position = Suspect.GetNetworkPosition(); if (Vector3.Distance(position, lastPosition) > 0.1f) { endPosition = position; Move = true; seconds = 0; return; } } else if (seconds == 0) { endPosition = Suspect.transform.position; } }
public Suspect UpdateSuspect(Suspect updateSus) { var orgSus = _dbContext.Suspects.Find(updateSus.SusId); if (orgSus == null) { throw new AppException("Suspect does not exist."); } else { orgSus.SusName = updateSus.SusName; orgSus.SusDescription = updateSus.SusDescription; _dbContext.Suspects.Update(orgSus); _dbContext.SaveChanges(); return(orgSus); } }
private void CreateWorldMap() { startUp = new Location("a rundown open office, with yellowing paperwork on the desks and notes from old investigations written in chalk on the blackboards", "ACME Headquarters"); Location prague = new Location("The capital city of the Czech Republic", "Prague"); Location shanghai = new Location("", "Shanghai"); Location vienna = new Location("", "Vienna"); startUp.AddDestination(prague.Name, new Destination(prague.Description, prague)); startUp.AddDestination(shanghai.Name, new Destination(shanghai.Description, shanghai)); startUp.AddDestination(vienna.Name, new Destination(vienna.Description, vienna)); // Create suspects Suspect robArr = new Suspect("Rob Arr", "Male", "Brown", "Brown", "Golf", "Scar", "Volkswagon"); // Create case currentCase = new Case(1, "Valuable Treasure", "preserved artifacts from Jewish synagogues", robArr, prague); }
public void GetConstraintsTest() { Player playerShowingCard = new Player("test"); Card cardSeen = new Weapon("test"); Card anotherCard = new Suspect("test"); Node[] nodes = new Node[] { new Node(playerShowingCard, cardSeen), new Node(playerShowingCard, anotherCard), }; SpyCard target = new SpyCard(playerShowingCard, cardSeen); var actual = target.GetConstraints(nodes); Assert.AreEqual(1, actual.Count()); SelectionCountConstraint c = actual.First() as SelectionCountConstraint; Assert.IsNotNull(c); Assert.AreEqual(1, c.Min); Assert.AreEqual(1, c.Max); Assert.AreEqual(1, c.Nodes.Count()); Assert.AreSame(nodes[0], c.Nodes.First()); }
private void PopulateCrimesData(Suspect suspect) { var allCrimes = db.Crimes; var suspectCrimes = new HashSet <int>(suspect.Crimes.Select(c => c.CrimeId)); var viewModel = new List <AssignCrimeData>(); foreach (var crimes in allCrimes) { viewModel.Add(new AssignCrimeData { CrimeId = crimes.CrimeId, TypeOfCrimeId = crimes.TypeOfCrimeId, Description = crimes.Description, Date = crimes.Date, TypeOfCrime = crimes.TypeOfCrime, Assigned = suspectCrimes.Contains(crimes.CrimeId) }); } ViewBag.Crimes = viewModel; }
public bool CheckAddedSuspects(Suspect newSuspect) { bool alreadyAdded = false; if (foundSuspects.Count < 1) // You have no power (and stuff) here! { return(false); } for (int i = 0; i < foundSuspects.Count; i++) { if (foundSuspects[i] == newSuspect) // Found it, stop checking! { alreadyAdded = true; break; } } return(alreadyAdded); }
public Task <Suspect> GetBanStatusForUser(string steamId) { Suspect suspect = new Suspect { SteamId = "133713371337", ProfileUrl = "http://steamcommunity.com/id/133713371337/", Nickname = "The Suspect", CurrentStatus = 0, ProfileState = 0, AvatarUrl = "http://cdn.akamai.steamstatic.com/steamcommunity/public/images/avatars/fe/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_full.jpg", CommunityVisibilityState = 0, DaySinceLastBanCount = 10, BanCount = 1, VacBanned = true, CommunityBanned = false, EconomyBan = "none" }; return(Task.FromResult(suspect)); }
private void item_EpiCaseDefinitionChanging(object sender, Events.EpiCaseDefinitionChangingEventArgs e) { CaseViewModel caseVM = sender as CaseViewModel; if (caseVM != null) { if (e.PreviousDefinition == EpiCaseClassification.Confirmed) { Confirmed.Remove(caseVM); } else if (e.PreviousDefinition == EpiCaseClassification.Probable) { Probable.Remove(caseVM); } else if (e.PreviousDefinition == EpiCaseClassification.Suspect) { Suspect.Remove(caseVM); } else if (e.PreviousDefinition == EpiCaseClassification.NotCase) { NotCase.Remove(caseVM); } if (e.NewDefinition == EpiCaseClassification.Confirmed) { Confirmed.Add(caseVM); } else if (e.NewDefinition == EpiCaseClassification.Probable) { Probable.Add(caseVM); } else if (e.NewDefinition == EpiCaseClassification.Suspect) { Suspect.Add(caseVM); } else if (e.NewDefinition == EpiCaseClassification.NotCase) { NotCase.Add(caseVM); } } }
/// <summary> /// Add a player to the suspects banned list /// </summary> /// <param name="suspect"></param> /// <returns></returns> public async Task <bool> AddSuspectToBannedList(Suspect suspect) { // Get current list List <string> ids = await GetSuspectsBannedList(); // Check if already in the list if (ids.Contains(suspect.SteamId)) { return(false); } ids.Add(suspect.SteamId); // If not add it and update string json = await Task.Factory.StartNew(() => JsonConvert.SerializeObject(ids)); string pathSuspectsBannedFileJson = _pathFolderCache + "\\" + SUSPECT_BANNED_FILENAME; File.WriteAllText(pathSuspectsBannedFileJson, json); return(true); }
// Start is called before the first frame update void Start() { GameObject.Find("GameObject").GetComponent <AudioSource>().Stop(); GameObject.Find("GameManager").GetComponent <AudioSource>().Stop(); Suspect sus = CharacterCreation.Instance.CurrentSuspect; switch (sus.Ending) { case 1: WinCanvas.SetActive(true); GameObject.Find("GameObject").GetComponent <AudioSource>().clip = win; GameObject.Find("GameObject").GetComponent <AudioSource>().Play(); break; default: LoseCanvas.SetActive(true); GameObject.Find("GameObject").GetComponent <AudioSource>().clip = lose; GameObject.Find("GameObject").GetComponent <AudioSource>().Play(); break; } }
public ActionResult Create([Bind(Include = "CountryId,PictureId,Name,Alias,Age,Crime_CrimeId")] Suspect suspect, string[] selectedCrimes, HttpPostedFileBase upload) { if (selectedCrimes != null) { suspect.Crimes = new List <Crime>(); foreach (var crime in selectedCrimes) { var crimeToAdd = db.Crimes.Find(int.Parse(crime)); suspect.Crimes.Add(crimeToAdd); } } try { if (ModelState.IsValid) { if (upload != null && upload.ContentLength > 0) { var photo = new FilePath { FileName = System.IO.Path.GetFileName(upload.FileName), Filetype = FileType.Photo }; suspect.FilePaths = new List <FilePath>(); suspect.FilePaths.Add(photo); upload.SaveAs(Path.Combine(Server.MapPath("~/images"), photo.FileName)); } db.Suspects.Add(suspect); db.SaveChanges(); return(RedirectToAction("Index")); } } catch (DataException) { ModelState.AddModelError("", "Kan ikke lagre endringer. Prøv igjen, om problemet fortsetter kontakt din system administrator."); } PopulateCrimesData(suspect); ViewBag.CountryId = new SelectList(db.Countries, "CountryId", "CountryName", suspect.CountryId); return(View(suspect)); }
public override bool OnCalloutAccepted() { SuspectCar = new Vehicle(TruckModels[AssortedCalloutsHandler.rnd.Next(TruckModels.Length)], SpawnPoint, SpawnHeading); SuspectCar.RandomiseLicencePlate(); SuspectCar.MakePersistent(); CarModelName = SuspectCar.Model.Name.ToLower(); CarModelName = char.ToUpper(CarModelName[0]) + CarModelName.Substring(1); try { //CarColor = SuspectCar.GetColors().PrimaryColorName + "~s~-coloured"; } catch (Exception e) { //CarColor = "weirdly-coloured"; } Suspect = SuspectCar.CreateRandomDriver(); Suspect.MakeMissionPed(); int NumberOfImmigrants = AssortedCalloutsHandler.rnd.Next(1, 5); for (int i = 0; i < NumberOfImmigrants; i++) { Game.LogTrivial("Spawning immigrant"); Ped immigrant = new Ped(ImmigrantModels[AssortedCalloutsHandler.rnd.Next(ImmigrantModels.Length)], Vector3.Zero, 0f); immigrant.MakeMissionPed(); IllegalImmigrants.Add(immigrant); immigrant.WarpIntoVehicle(SuspectCar, i + 1); Persona immigrantpersona = Functions.GetPersonaForPed(immigrant); immigrantpersona.Wanted = true; Functions.SetPersonaForPed(immigrant, immigrantpersona); } Game.DisplayNotification("3dtextures", "mpgroundlogo_cops", "Illegal Immigrants in Truck", "Dispatch to ~b~" + AssortedCalloutsHandler.DivisionUnitBeat, "Citizens reporting ~r~illegal immigrants in a truck. ~b~Investigate the truck."); CalloutHandler(); return(base.OnCalloutAccepted()); }
protected override void ClearItems() { foreach (CaseViewModel c in this) { c.EpiCaseDefinitionChanging -= item_EpiCaseDefinitionChanging; c.CaseIDChanging -= item_CaseIDChanging; c.CaseSecondaryIDChanging -= item_CaseIDChanging; c.MarkedForRemoval -= item_MarkedForRemoval; c.Inserted -= item_Inserted; c.Updated -= item_Updated; c.ViewerClosed -= item_ViewerClosed; c.SwitchToLegacyEnter -= item_SwitchToLegacyEnter; } _master.Clear(); Confirmed.Clear(); Probable.Clear(); Suspect.Clear(); NotCase.Clear(); base.ClearItems(); }
private void WaitForGetClose() { while (CalloutRunning) { GameFiber.Yield(); PoliceCar.ShouldVehiclesYieldToThisVehicle = false; if (Vector3.Distance(Game.LocalPlayer.Character.Position, PoliceOfficer.Position) < 45f) { Game.DisplayHelp("Park up behind the vehicles and make contact with the officer."); SuspectBlip = Suspect.AttachBlip(); SuspectBlip.Color = Color.Red; SuspectBlip.Scale = 0.7f; PoliceOfficerBlip.IsRouteEnabled = false; PoliceOfficerBlip.Scale = 0.7f; if (ComputerPlusRunning) { API.ComputerPlusFuncs.SetCalloutStatusToAtScene(CalloutID); } break; } } }
private void DisplayCodeFourMessage() { if (CalloutRunning) { msg = ""; if (Suspect.Exists()) { if (Functions.IsPedArrested(Suspect)) { msg = "The suspect is ~g~under arrest~s~. "; } else if (Suspect.IsDead) { msg = "The suspect is ~o~dead~s~. "; } } if (Victim.Exists()) { if (Victim.IsAlive) { msg += "The victim ~g~survived. ~s~"; } else { msg += "The victim ~r~was killed. ~s~"; } } msg += "We are ~g~CODE 4~s~."; GameFiber.Sleep(4000); Game.DisplayNotification("3dtextures", "mpgroundlogo_cops", "Person with a knife", "Dispatch to ~b~" + AssortedCalloutsHandler.DivisionUnitBeat, msg); Functions.PlayScannerAudio("ATTENTION_THIS_IS_DISPATCH_HIGH WE_ARE_CODE FOUR NO_FURTHER_UNITS_REQUIRED"); CalloutFinished = true; End(); } }
public override bool OnBeforeCalloutDisplayed() { //Create our ped in the world Suspect myPed = new Suspect("Suspect1", "a_m_y_mexthug_01", SpawnPoint.Around(10), 0); //Create the vehicle for our ped Vehicle myVehicle = new Vehicle("DUKES2", SpawnPoint); //Now we have spawned them, check they actually exist and if not return false (preventing the callout from being accepted and aborting it) if (!myPed.Exists()) { return(false); } if (!myVehicle.Exists()) { return(false); } //Add the Ped to the callout's list of Peds Peds.Add(myPed); //If we made it this far both exist so let's warp the ped into the driver seat myPed.WarpIntoVehicle(myVehicle, -1); // Show the user where the pursuit is about to happen and block very close peds. this.ShowCalloutAreaBlipBeforeAccepting(SpawnPoint, 15f); this.AddMinimumDistanceCheck(5f, myPed.Position); // Set up our callout message and location this.CalloutMessage = "Example Callout Message"; this.CalloutPosition = SpawnPoint; //Play the police scanner audio for this callout (available as of the 0.2a API) Functions.PlayScannerAudioUsingPosition("CITIZENS_REPORT CRIME_RESIST_ARREST IN_OR_ON_POSITION", SpawnPoint); return(base.OnBeforeCalloutDisplayed()); }
public override bool OnCalloutAccepted() { PoliceCar = new Vehicle(CopCarModel, SpawnPoint, SpawnHeading); PoliceCar.MakePersistent(); PoliceCar.IsSirenOn = true; PoliceCar.IsSirenSilent = true; PoliceOfficer = PoliceCar.CreateRandomDriver(); PoliceOfficer.MakeMissionPed(); PoliceOfficerBlip = PoliceOfficer.AttachBlip(); PoliceOfficerBlip.Color = Color.Green; PoliceOfficerBlip.IsRouteEnabled = true; PoliceOfficer.RelationshipGroup = "PLAYER"; SuspectCar = new Vehicle(GroundVehiclesToSelectFrom[AssortedCalloutsHandler.rnd.Next(GroundVehiclesToSelectFrom.Length)], PoliceCar.GetOffsetPosition(Vector3.RelativeFront * 9f), PoliceCar.Heading); SuspectCar.MakePersistent(); Suspect = SuspectCar.CreateRandomDriver(); Suspect.MakeMissionPed(); Suspect.WarpIntoVehicle(PoliceCar, PoliceCar.PassengerCapacity - 1); Functions.SetPedAsArrested(Suspect); Suspect.Tasks.PlayAnimation("mp_arresting", "idle", 8f, AnimationFlags.UpperBodyOnly | AnimationFlags.SecondaryTask | AnimationFlags.Loop); Suspect.RelationshipGroup = "TBACKUPCRIMINAL"; MainLogic(); return(base.OnCalloutAccepted()); }
private void CalloutHandler() { CalloutRunning = true; GameFiber.StartNew(delegate { try { Pursuit = Functions.CreatePursuit(); NativeFunction.CallByName <uint>("SET_DRIVER_ABILITY", Suspect, 1.0f); NativeFunction.CallByName <uint>("SET_DRIVER_AGGRESSIVENESS", Suspect, 1.0f); Functions.AddPedToPursuit(Pursuit, Suspect); if (AssortedCalloutsHandler.rnd.Next(3) == 0) { Passenger = new Ped(Vector3.Zero); Passenger.MakeMissionPed(); Passenger.WarpIntoVehicle(SuspectCar, 0); Functions.AddPedToPursuit(Pursuit, Passenger); } Functions.SetPursuitIsActiveForPlayer(Pursuit, true); GameFiber.Wait(3000); Vehicle Backupveh = Functions.RequestBackup(Suspect.Position, LSPD_First_Response.EBackupResponseType.Pursuit, LSPD_First_Response.EBackupUnitType.LocalUnit); Backupveh.Position = SpawnPoint; Backupveh.Heading = SpawnHeading; NativeFunction.Natives.SET_VEHICLE_FORWARD_SPEED(Backupveh, 10f); Game.DisplayNotification("~b~Pursuing Officer: ~s~Suspect is on ~b~" + World.GetStreetName(Suspect.Position) + ". ~s~Speed is ~r~" + Math.Round(MathHelper.ConvertMetersPerSecondToMilesPerHour(Suspect.Speed)).ToString() + " MPH."); SuspectBlip = Suspect.AttachBlip(); SuspectBlip.Scale = 0.1f; SuspectBlip.IsRouteEnabled = true; SuspectBlip.RouteColor = Color.Red; if (SuspectCar.HasSiren) { SuspectCar.IsSirenOn = true; } if (!Passenger.Exists()) { while (CalloutRunning) { GameFiber.Yield(); if (!Suspect.Exists()) { msg = "Control, the ~r~suspect~s~ has ~r~escaped.~s~ Hot pursuit is code 4, over."; break; } else if (Functions.IsPedArrested(Suspect)) { msg = "Control, the ~r~suspect~s~ is ~g~under arrest.~s~ Hot pursuit is code 4, over."; break; } else if (Suspect.IsDead) { msg = "Control, the ~r~suspect~s~ is ~o~dead.~s~ Hot pursuit is code 4, over."; break; } if (Vector3.Distance(Suspect.Position, Game.LocalPlayer.Character.Position) < 60f) { if (SuspectBlip.Exists()) { SuspectBlip.Delete(); } } } } else if (CalloutRunning) { Functions.AddPedToPursuit(Pursuit, Passenger); PassengerState = SuspectStates.InPursuit; SuspectState = SuspectStates.InPursuit; while (CalloutRunning) { GameFiber.Yield(); if (SuspectState == SuspectStates.InPursuit) { if (!Suspect.Exists()) { SuspectState = SuspectStates.Escaped; } else if (Suspect.IsDead) { SuspectState = SuspectStates.Dead; } else if (Functions.IsPedArrested(Suspect)) { SuspectState = SuspectStates.Arrested; } } if (PassengerState == SuspectStates.InPursuit) { if (!Passenger.Exists()) { PassengerState = SuspectStates.Escaped; } else if (Passenger.IsDead) { PassengerState = SuspectStates.Dead; } else if (Functions.IsPedArrested(Passenger)) { PassengerState = SuspectStates.Arrested; } } if ((SuspectState != SuspectStates.InPursuit) && (PassengerState != SuspectStates.InPursuit)) { break; } if (Vector3.Distance(Suspect.Position, Game.LocalPlayer.Character.Position) < 60f) { if (SuspectBlip.Exists()) { SuspectBlip.Delete(); } } } msg = "Control, the driver's "; if (SuspectState == SuspectStates.Arrested) { msg += "~g~under arrest."; } else if (SuspectState == SuspectStates.Dead) { msg += "~o~dead."; } else if (SuspectState == SuspectStates.Escaped) { msg += "~r~escaped."; } msg += "~s~ The passenger's "; if (PassengerState == SuspectStates.Arrested) { msg += "~g~under arrest."; } else if (PassengerState == SuspectStates.Dead) { msg += "~o~dead."; } else if (PassengerState == SuspectStates.Escaped) { msg += "~r~escaped."; } msg += "~s~ Hot pursuit is code 4, over."; } DisplayCodeFourMessage(); } catch (System.Threading.ThreadAbortException e) { End(); } catch (Exception e) { if (CalloutRunning) { Game.LogTrivial(e.ToString()); Game.LogTrivial("British Policing Script handled the exception successfully."); Game.DisplayNotification("~O~Failtostop~s~ callout crashed, sorry. Please send me your log file."); Game.DisplayNotification("Full LSPDFR crash prevented ~g~successfully."); End(); } } }); }
public MurderSet(Suspect suspect, Weapon weapon, Room room) { m_suspect = suspect; m_weapon = weapon; m_room = room; }
public SuspectInfo(Suspect name, Func <KMBombInfo, Suspect[], Suspect[], Suspect> godfatherGetter) { Name = name; GodfatherGetter = (bomb, suspects, eliminated, startingTime) => godfatherGetter(bomb, suspects, eliminated); }
public SuspectInfo(Suspect name, Func <KMBombInfo, Suspect[], Suspect[], float, Suspect> godfatherGetter) { Name = name; GodfatherGetter = godfatherGetter; }
public void ToStringTest() { Card c = new Suspect("testSuspect"); Assert.AreEqual(c.Name, c.ToString()); }
private void Setup() { _pncId = new PNCId("1234-ESDT"); _suspect = new Suspect(CriminalOffence.FALSE_ACCOUNTING); _anInvestigation = new PoliceInvestigation(_pncId, _suspect); }
private IEnumerator Initialize(bool firstRun, int startFrom) { _animating = true; yield return(null); if (firstRun) { _startingTime = Bomb.GetTime() / 60; Debug.LogFormat("[Mafia #{0}] Bomb starting time: {1} minutes", _moduleId, _startingTime); } for (int i = 0; i < _numSuspects; i++) { StickFigures[(i + startFrom) % _numSuspects].gameObject.SetActive(false); if (!firstRun) { yield return(new WaitForSeconds(.05f)); } } _suspects = _allSuspects.ToArray().Shuffle().Take(_numSuspects).ToArray(); var positions = "top left|top right|right top|right bottom|bottom right|bottom left|left bottom|left top".Split('|'); for (int i = 0; i < _numSuspects; i++) { Debug.LogFormat("[Mafia #{0}] {1} suspect: {2}", _moduleId, positions[i], _suspects[i]); NameMeshes[i].text = _suspects[i].ToString(); } var num = Bomb.GetSerialNumber().Select(c => c >= 'A' && c <= 'Z' ? c - 'A' + 1 : c - '0').Sum(); Debug.LogFormat("[Mafia #{0}] Serial number sum is: {1} ({2}).", _moduleId, num, _allSuspects[(num - 1) % _allSuspects.Length]); while (!_suspects.Contains(_allSuspects[(num - 1) % _allSuspects.Length])) { num++; } Debug.LogFormat("[Mafia #{0}] First matching suspect is: {1} ({2}).", _moduleId, num, _allSuspects[(num - 1) % _allSuspects.Length]); var left = new List <Suspect>(_suspects); if (Bomb.GetIndicators().Count() >= 2) { left.Reverse(); Debug.LogFormat("[Mafia #{0}] Eliminating suspects in counter-clockwise order.", _moduleId); } else { Debug.LogFormat("[Mafia #{0}] Eliminating suspects in clockwise order.", _moduleId); } var eliminated = new List <Suspect>(); var ix = left.IndexOf(_allSuspects[(num - 1) % _allSuspects.Length]); var lastDigit = Bomb.GetSerialNumberNumbers().Last(); for (int i = 0; i < _numSuspects - 1; i++) { eliminated.Add(left[ix]); Debug.LogFormat("[Mafia #{0}] Eliminating {1}.", _moduleId, left[ix]); left.RemoveAt(ix); ix = (ix + lastDigit) % left.Count; } Debug.LogFormat("[Mafia #{0}] Last remaining suspect is {1}.", _moduleId, left[0]); _godfather = _suspectInfos[left[0]].GetGodfather(Bomb, _suspects, eliminated.ToArray(), _startingTime); Debug.LogFormat("[Mafia #{0}] Godfather is {1}.", _moduleId, _godfather); yield return(new WaitForSeconds(1.5f)); var startFrom2 = Rnd.Range(0, _numSuspects); for (int i = 0; i < _numSuspects; i++) { StickFigures[(i + startFrom2) % _numSuspects].gameObject.SetActive(true); yield return(new WaitForSeconds(.15f)); } _animating = false; }
public async Task <Suspect> GetBanStatusForUser(string steamId) { Suspect suspect = new Suspect(); try { using (var httpClient = new HttpClient()) { // Grab general infos from user string url = string.Format(PLAYERS_SUMMARIES_URL, Properties.Resources.steam_api_key, steamId); HttpResponseMessage result = await httpClient.GetAsync(url); if (result.StatusCode == HttpStatusCode.OK) { string json = await result.Content.ReadAsStringAsync(); JObject o = JObject.Parse(json); var playerSummary = o.SelectToken("response.players.player[0]").ToObject <PlayerSummary>(); if (playerSummary == null) { return(null); } // Grab VAC ban infos from user url = string.Format(PLAYERS_BAN_URL, Properties.Resources.steam_api_key, steamId); result = await httpClient.GetAsync(url); if (result.StatusCode == HttpStatusCode.OK) { json = await result.Content.ReadAsStringAsync(); o = JObject.Parse(json); var playerBan = o.SelectToken("players[0]").ToObject <PlayerBan>(); if (playerBan == null) { return(null); } suspect = new Suspect { SteamId = playerSummary.SteamId, ProfileUrl = playerSummary.ProfileUrl, Nickname = playerSummary.PersonaName, LastLogOff = playerSummary.LastLogoff, CurrentStatus = playerSummary.PersonaState, ProfileState = playerSummary.ProfileState, AvatarUrl = playerSummary.AvatarFull, CommunityVisibilityState = playerSummary.CommunityVisibilityState, DaySinceLastBanCount = playerBan.DaysSinceLastBan, BanCount = playerBan.NumberOfVacBans, VacBanned = playerBan.VacBanned, CommunityBanned = playerBan.CommunityBanned, EconomyBan = playerBan.EconomyBan, GameBanCount = playerBan.NumberOfGameBans }; return(suspect); } return(null); } return(null); } } catch (Exception e) { Logger.Instance.Log(e); } return(suspect); }
public void EqualsTest() { Card c = new Suspect("test"); Assert.IsTrue(c.Equals(c)); }
private Card(Suspect suspect, Weapon weapon, Room room) { m_suspect = suspect; m_weapon = weapon; m_room = room; }
public void SuspectConstructorTest() { const string name = "Test"; Card c = new Suspect(name); Assert.AreEqual(name, c.Name); }