Exemple #1
0
 void OnTriggerExit2D(Collider2D other)
 {
     if (other.CompareTag("Bucket"))
     {
         bucket = null;
     }
 }
Exemple #2
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Bucket"))
     {
         bucket = other.gameObject.GetComponent <Mixing>();
     }
 }
Exemple #3
0
        public void MixListOfWaves_NoWave()
        {
            short[] actual   = Mixing.MixListOfWaves(new List <short[]> {
            });
            short[] expected = new short[] { };

            Assert.Equal(expected, actual);
        }
Exemple #4
0
 protected override void DroppedOn(Mixing other)
 {
     transform.position = other.transform.position + new Vector3(0f, 0.5f);
     // TODO: Initiate shaking
     actualShaker.SetMixing(other);
     actualShaker.gameObject.SetActive(true);
     this.gameObject.SetActive(false);          // disable the Draggable script
 }
Exemple #5
0
 public static void Main()
 {
     Console.WriteLine("[{0}]", Mixing.Mix("Are they here", "yes, they are here"));
     Console.WriteLine("[{0}]", Mixing.Mix("looping is fun but dangerous", "less dangerous than coding"));
     Console.WriteLine("[{0}]", Mixing.Mix(" In many languages", " there's a pair of functions"));
     Console.WriteLine("[{0}]", Mixing.Mix("Lords of the Fallen", "gamekult"));
     Console.WriteLine("[{0}]", Mixing.Mix("codewars", "codewars"));
     Console.WriteLine("[{0}]", Mixing.Mix("A generation must confront the looming ", "codewarrs"));
 }
Exemple #6
0
        public void MixListOfWaves_OneWave()
        {
            short[] wave   = new short[] { 3, 1, 4, 5 };
            short[] actual = Mixing.MixListOfWaves(new List <short[]> {
                wave
            });
            short[] expected = wave;

            Assert.Equal(expected, actual);
        }
 public static void test2()
 {
     Assert.AreEqual("1:ooo/1:uuu/2:sss/=:nnn/1:ii/2:aa/2:dd/2:ee/=:gg",
                     Mixing.Mix("looping is fun but dangerous", "less dangerous than coding"));
     Assert.AreEqual("1:aaa/1:nnn/1:gg/2:ee/2:ff/2:ii/2:oo/2:rr/2:ss/2:tt",
                     Mixing.Mix(" In many languages", " there's a pair of functions"));
     Assert.AreEqual("1:ee/1:ll/1:oo", Mixing.Mix("Lords of the Fallen", "gamekult"));
     Assert.AreEqual("", Mixing.Mix("codewars", "codewars"));
     Assert.AreEqual("1:nnnnn/1:ooooo/1:tttt/1:eee/1:gg/1:ii/1:mm/=:rr",
                     Mixing.Mix("A generation must confront the looming ", "codewarrs"));
 }
Exemple #8
0
        public void MixListOfWaves_TwoWavesFirstShorter()
        {
            short[] wave1  = new short[] { 3, 1, 4, 5 };
            short[] wave2  = new short[] { 5, 7, 4, 7, 2 };
            short[] actual = Mixing.MixListOfWaves(new List <short[]> {
                wave1, wave2
            });
            short[] expected = new short[] { 4, 4, 4, 6, 2 };

            Assert.Equal(expected, actual);
        }
Exemple #9
0
        public void MixListOfWaves_TwoWavesEqualLength()
        {
            short[] wave1  = new short[] { 3, 1, 4, 5 };
            short[] wave2  = new short[] { 7, 3, 2, 9 };
            short[] actual = Mixing.MixListOfWaves(new List <short[]> {
                wave1, wave2
            });
            short[] expected = new short[] { 5, 2, 3, 7 };

            Assert.Equal(expected, actual);
        }
Exemple #10
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.CompareTag("Bucket"))
        {
            flaming = true;

            if (mix == null)
            {
                mix = other.GetComponent <Mixing> ();
            }
        }
    }
Exemple #11
0
        public void MixListOfWaves_ThreeWavesAllDifferent()
        {
            short[] wave1  = new short[] { 3, 1, 4, 5 };
            short[] wave2  = new short[] { 4, 2, 1, 4, 2 };
            short[] wave3  = new short[] { 2, 6, 4 };
            short[] actual = Mixing.MixListOfWaves(new List <short[]> {
                wave1, wave2, wave3
            });
            short[] expected = new short[] { 3, 3, 3, 4, 2 };

            Assert.Equal(expected, actual);
        }
Exemple #12
0
    public void Mix()
    {
        if (!finishedMixing)
        {
            Debug.Log("Must perform action on mixing bowl first");
            return;
        }
        Debug.Log(this.element);
        Mixing mix = this.GetComponent <Mixing> ();
        List <IngredientData> ingredients = mix.GetIngredients();

        drink.Mix(this.element, this.ingredients);
        ClearIngredients();
    }
Exemple #13
0
 public void SetMixing(Mixing toMix)
 {
     this.mixingBowl = toMix;
 }
Exemple #14
0
 protected override void DroppedOn(Mixing other)
 {
     other.Drop(this.data);
     this.SetData();
     this.ResetPosition();
 }
Exemple #15
0
 protected override void DroppedOn(Mixing other)
 {
     breakingIce.SetActive(true);
     this.gameObject.SetActive(false);
 }
Exemple #16
0
 // DroppedOn should not necessarily do anything
 protected virtual void DroppedOn(Mixing other)
 {
 }
 public static void test1()
 {
     Assert.AreEqual("2:eeeee/2:yy/=:hh/=:rr", Mixing.Mix("Are they here", "yes, they are here"));
 }
Exemple #18
0
 protected override void DroppedOn(Mixing other)
 {
     ResetPosition();
 }