Beispiel #1
0
    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();
    }
Beispiel #2
0
 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());
 }
Beispiel #3
0
        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!");
            }
        }
Beispiel #4
0
 static public void RemoveOneWhistle(Whistle whistle)
 {
     whistleList.Remove(whistle);
     whistle.TagToDestroy();
 }
Beispiel #5
0
 void Start()
 {
     speakBehavior = new Whistle();
     moveBehavior  = new Swim();
 }