void Start() { ballPref = Resources.Load("prefab/ball") as GameObject; startBallPref = Resources.Load("prefab/startBall") as GameObject; forceUpEffect = Resources.Load("prefab/forceUp") as GameObject; whistlePrefs = (Resources.Load("prefab/whistle") as GameObject).GetComponent <Whistle>(); warmParticle(); LaunchMenu(); }
public async Task <ActionResult <DtoWhistle> > Post(DtoWhistle WhistleInput) { try { Whistle W = _mapper.Map <Whistle>(WhistleInput); _repository.Add(W); if (await _repository.SaveChangesAsync()) { return(Created($"/api/whistle/", _mapper.Map <DtoWhistle>(W))); } } catch { return(this.StatusCode(StatusCodes.Status500InternalServerError, "")); } return(BadRequest()); }
public void TestExerciseWhistleCreation() { using (StringWriter sw = new StringWriter()) { // Save a reference to the standard output. TextWriter stdout = Console.Out; // Redirect standard output to variable. Console.SetOut(sw); Whistle Whistle = new Whistle("test"); // Restore the original standard output. Console.SetOut(stdout); // Assert Assert.AreEqual(Whistle.GetType(), typeof(Whistle), "The Whistle should be able to be created with constructor call!"); } }
static public void RemoveOneWhistle(Whistle whistle) { whistleList.Remove(whistle); whistle.TagToDestroy(); }
void Start() { speakBehavior = new Whistle(); moveBehavior = new Swim(); }