void launchSuper(SuperList super)
    {
        superActive = true;
        colorSave   = team.GetPlayerColor();
        switch (super)
        {
        case SuperList.superDash:
            MyDebug.Log("Dash Super attack !");
            team.speedFactor = game.settings.Global.Super.superSpeedScale;
            team.setSpeed();

            this.SuperTimeLeft = settings.SuperDashDurationTime;
            break;

        case SuperList.superTackle:
            MyDebug.Log("Tackle Super attack !");
            team.tackleFactor = game.settings.Global.Super.superTackleBoxScale;
            team.setSpeed();
            break;

        case SuperList.superStun:
            MyDebug.Log("Stun Super attack !");
            team.opponent.StunEverybodyForSeconds(settings.SuperStunDurationTime);

            this.SuperTimeLeft = settings.SuperStunDurationTime;
            break;

        default:
            break;
        }

        //LauchFeedBack(super);
    }
Beispiel #2
0
        static void Main(string[] args)
        {
            try
            {
                SuperList <string> sll = new SuperList <string>();
                sll.Add("abc");
                sll.Add("cсссссcc");
                sll = sll + "hi";
                foreach (string st in sll)
                {
                    Console.WriteLine(st);
                }


                Console.WriteLine("Элемент,равный заданному ");
                Console.WriteLine(sll.First(p => p.Equals("abc")));



                Doctor  dr  = new Doctor();
                Patient pat = new Patient();

                dr.say_heal += pat.Heal;
                dr.CommandHeal();
            }
            catch (IndexOutOfRangeException e)
            {
                Console.WriteLine(e.Message);
            }
            Console.ReadKey();
        }
Beispiel #3
0
        private static void Main(string[] args)
        {
            IIterable list = new SuperList();
            IIterator<int> iterator = list.GetIterator();
            Console.WriteLine("SuperList iteration");
            Console.WriteLine(iterator.Current);
            const int maxIteration = 10;
            int counter = 0;
            while (!iterator.IsDone && counter < maxIteration)
            {
                ++counter;
                iterator.Next();
                Console.WriteLine(iterator.Current);
            }

            list = new OrdinaryList(10);
            var anotherIterator = list.GetIterator();
            Console.WriteLine("OrdinaryList iteration");
            Console.WriteLine(anotherIterator.Current);
            while (!anotherIterator.IsDone)
            {
                anotherIterator.Next();
                Console.WriteLine(anotherIterator.Current);
            }

            Console.WriteLine("press <enter> to exit");
            Console.ReadLine();
        }
Beispiel #4
0
        /// <summary>
        /// Shorthand for adding a transition to an existing list
        /// </summary>
        /// <param name="node">First transition</param>
        /// <param name="others">Alternative transitions</param>
        /// <returns>Modified list of transitions</returns>
        public static SuperList operator |(GraphNode node, SuperList others)
        {
            var list = new SuperList {
                node
            };

            list.AddRange(others);
            return(list);
        }
        public void SuperlistStoresInitialValue()
        {
            SuperList <int> superint = new SuperList <int>();

            superint.Add(1);
            int test     = superint[0];
            int expected = 1;

            Assert.AreEqual(test, expected);
        }
        public void ContainmentTest()
        {
            SuperList <char> superList = new SuperList <char>()
            {
                'a', 'b', 'c', 'd'
            };
            int test = superList.Contains('c');

            Assert.AreEqual(test, 2);
        }
Beispiel #7
0
 public void event_Super(Team t, SuperList super)
 {
     foreach (State tmp in list)
     {
         if (tmp.OnSuper(t, super))
         {
             return;
         }
     }
 }
        public void ClearingListRaisesEvents()
        {
            SuperList <double> testList = new SuperList <double>();

            for (int i = 0; i < 100; i++)
            {
                testList.Add((double)i);
            }

            testList.Clear();
        }
        public void SuperListStringtest2()
        {
            SuperList <char> superlist = new SuperList <char>()
            {
                'i', 't', 's', 'w', 'o', 'r', 'k', 'i', 'n', 'g'
            };
            string result   = superlist.ToString();
            string expected = "itsworking";

            Assert.AreEqual(result, expected);
        }
        public void SuperListStringtest3()
        {
            SuperList <string> superlist = new SuperList <string>()
            {
                "it's ", "definitely ", "working!"
            };
            string result   = superlist.ToString();
            string expected = "it's definitely working!";

            Assert.AreEqual(result, expected);
        }
        public void SuperlistCounts()
        {
            SuperList <int> superList = new SuperList <int>();

            superList.Add(1);
            superList.Add(2);
            superList.Add(3);
            int count = 3;

            Assert.AreEqual(superList.Count, count);
        }
        public void YeniOgeEkleninceSayiBirArtar()
        {
            SuperList <string> kelimeler = new SuperList <string>();
            var oncekiAdet = kelimeler.Count();

            kelimeler.Ekle("dünya");
            var sonrakiAdet = kelimeler.Count();

            bool birFazlasiMi = sonrakiAdet == oncekiAdet + 1;

            Assert.True(birFazlasiMi, "Ekleme sonrasý öðe sayýsý doðru deðil!");
        }
        public void SuperlistRemovesOne()
        {
            SuperList <int> superList = new SuperList <int>()
            {
                9, 8, 7, 6, 5, 4, 3, 2, 1
            };

            superList.Remove(9);
            int test = 9;

            Assert.AreNotEqual(superList[0], test);
        }
        public void SuperlistRemoveValueExpected()
        {
            SuperList <int> superList = new SuperList <int>()
            {
                9, 8, 7, 6, 5, 4, 3, 2, 1
            };

            superList.Remove(9);
            int?test = 8;

            Assert.AreEqual(superList[0], test);
        }
        public void SuperListStringtest1()
        {
            //i have to figure out how to detect types if I am going to be able to make the numbers format how I like.
            SuperList <int> superlist = new SuperList <int>()
            {
                10, 9, 8, 7, 6, 5, 4, 3, 2, 1
            };
            string result   = superlist.ToString();
            string expected = "10, 9, 8, 7, 6, 5, 4, 3, 2, 1";

            Assert.AreEqual(expected, result);
        }
        public void BosListeyeEklenenOgelerDogruSiradadir()
        {
            SuperList <int> sayilar = new SuperList <int>();

            sayilar.Ekle(3);
            sayilar.Ekle(5);
            var ilkOge    = sayilar.First();
            var ikinciOge = sayilar.Skip(1).First();

            Assert.Equal(3, ilkOge);
            Assert.Equal(5, ikinciOge);
        }
Beispiel #17
0
        public void SilmeSonrasiAdetAzalmali()
        {
            var liste = new SuperList <char>();

            liste.Ekle('a');
            liste.Ekle('b');
            liste.Ekle('c');
            // silme öncesi adet 3 olmalı
            Assert.Equal(3, liste.Count());
            liste.Sil('a');
            // silme sonrası adet 2 olmalı
            Assert.Equal(2, liste.Count());
        }
        public void SuperlistStoresAdditionalValues()
        {
            SuperList <string> superList = new SuperList <string>();

            superList.Add("is");
            superList.Add("this");
            superList.Add("working");
            superList.Add("is");
            superList.Add("this");
            superList.Add("working");
            //I like it, it's staying ugly.
            Assert.IsTrue(superList[0] == superList[3] && superList[1] == superList[4] && superList[2] == superList[5] && superList[0] != superList[1]);
        }
        public void SuperAddCapacity()
        {
            SuperList <int> superList = new SuperList <int>();
            int             test1     = superList.Capacity;

            for (int i = 0; i < 10; i++)
            {
                superList.Add(i);
            }
            int test2 = superList.Capacity;

            Assert.AreNotEqual(test1, test2);
        }
        public void SuperlistRemoveAdjustsCount()
        {
            SuperList <int> superList = new SuperList <int>()
            {
                0, 1, 0, 1, 0, 1
            };
            int test1 = superList.Count;

            superList.Remove(1);
            int test2 = superList.Count;

            Assert.IsTrue(test1 == test2 + 1);
        }
        public void RemoveAtTest()
        {
            SuperList <int> superList = new SuperList <int>()
            {
                1, 2, 3, 4, 5, 6, 7, 8, 9
            };

            superList.RemoveAt(3);
            int test    = superList[3];
            int expeted = 5;

            Assert.AreEqual(test, expeted);
        }
Beispiel #22
0
    public void OnSuper(Team team, SuperList super)
    {
        //if (team.captain.unitAnimator)
        //{
        //    team.captain.unitAnimator.PrepareSuper();
        //}

        foreach (Unit u in team)
        {
            u.unitAnimator.PrepareSuper();
        }

        this.refs.stateMachine.event_Super(team, super);
    }
Beispiel #23
0
 public bool ObjectPosition(float x, float y, Type type)
 {
     if (SuperList.TryGetValue(type, out list) && list.Count != 0)
     {
         foreach (CollideableGameObject obj in list)
         {
             if (obj.X == x && obj.Y == y)
             {
                 return(true);
             }
         }
     }
     return(false);
 }
        public void SuperListCopiesDataCorrectly2()
        {
            SuperList <int> superList = new SuperList <int>()
            {
                1, 2, 3
            };

            for (int i = 0; i < 10; i++)
            {
                superList.Add(5);
            }

            Assert.AreEqual(superList[1], 2);
        }
        public void SuperSortUp()
        {
            SuperList <int> superlist = new SuperList <int>()
            {
                9, 1, 8, 2, 7, 3, 6, 4, 5
            };

            superlist.SortUP();
            for (int i = 0; i < superlist.Count; i++)
            {
                int num = i + 1;
                Assert.AreEqual(num, superlist[i]);
            }
        }
        public void SuperlistCanStoreManyTypes()
        {
            SuperList <string> superstring = new SuperList <string>()
            {
                "0.025", "2"
            };
            SuperList <double> superDouble = new SuperList <double>()
            {
                0.025, 2.0
            };
            double test1 = double.Parse(superstring[0]);

            Assert.AreEqual(superDouble[0], test1);
        }
        public void SuperListcountdecrementssOnRemove()
        {
            SuperList <int> superList = new SuperList <int>()
            {
                0, 1, 0, 1, 0, 1
            };
            int test1 = 3;

            superList.Remove(1);
            superList.Remove(1);
            superList.Remove(1);
            int test2 = superList.Count;

            Assert.AreEqual(test1, test2);
        }
        public void SuperListCleanWorks()
        {
            SuperList <int> superList = new SuperList <int>()
            {
                5, 4, 3, 2, 1
            };

            superList.RemoveAt(0);
            superList.RemoveAt(0);
            superList.RemoveAt(0);
            superList.CleanArray();
            int test1 = superList.Capacity;

            Assert.AreEqual(test1, 2);
        }
        public void CanGetAddEvent()
        {
            string testItem    = "abc";
            bool   eventCaught = false;

            SuperList <string> testList = new SuperList <string>();

            testList.ItemAdded += (s, e) =>
            {
                eventCaught = true;
                Assert.AreEqual(testItem, e.Item);
                Assert.IsTrue(object.ReferenceEquals(testItem, e.Item));
            };
            testList.Add(testItem);
            Assert.IsTrue(eventCaught);
        }
        public void SuperSortDown()
        {
            SuperList <int> superlist = new SuperList <int>()
            {
                9, 1, 8, 2, 7, 3, 6, 4, 5
            };

            superlist.SortDown();
            int counter = 0;

            for (int i = superlist.Count; i > 0; i--)
            {
                Assert.AreEqual(i, superlist[counter]);
                counter++;
            }
        }
Beispiel #31
0
        public void SilinmeyiDogrula()
        {
            var liste = new SuperList <char>();

            liste.Ekle('a');
            liste.Ekle('b');
            liste.Ekle('c');
            // silme öncesi a,b,c listede bulunmalı
            Assert.Contains('a', liste);
            Assert.Contains('b', liste);
            Assert.Contains('c', liste);
            liste.Sil('b');
            // silme sonrası a ve c durmalı b silinmiş olmalı
            Assert.Contains('a', liste);
            Assert.DoesNotContain('b', liste);
            Assert.Contains('c', liste);
        }
Beispiel #32
0
    public void OnSuper(Team team, SuperList super)
    {
        //if (team.captain.unitAnimator)
        //{
        //    team.captain.unitAnimator.PrepareSuper();
        //}

        foreach (Unit u in team)
            u.unitAnimator.PrepareSuper();

        this.refs.stateMachine.event_Super(team, super);
    }
Beispiel #33
0
 //Team "State Machine"
 public virtual bool OnSuper(Team t, SuperList super)
 {
     return (false);
 }
Beispiel #34
0
 public void event_Super(Team t, SuperList super)
 {
     foreach (State tmp in list)
     {
         if (tmp.OnSuper(t, super))
             return;
     }
 }
Beispiel #35
0
 public override bool OnSuper(Team t, SuperList super)
 {
     sm.state_change_son(this, new WaitingState(sm,cam,game,3.5f,t));
     return true;
 }
Beispiel #36
0
 /// <summary>
 /// Shorthand for adding a transition to an existing list 
 /// </summary>
 /// <param name="node">First transition</param>
 /// <param name="others">Alternative transitions</param>
 /// <returns>Modified list of transitions</returns>
 public static SuperList operator |(OwinNode node, SuperList others)
 {
     var list = new SuperList { node };
     list.AddRange(others);
     return list;
 }
Beispiel #37
0
 void LauchFeedBack(SuperList super)
 {
     team.PlaySuperParticleSystem(super, true);
 }
Beispiel #38
0
    void launchSuper(SuperList super)
    {
        superActive = true;
        colorSave = team.GetPlayerColor();
        switch (super){
            case SuperList.superDash:
                MyDebug.Log("Dash Super attack !");
                team.speedFactor = game.settings.Global.Super.superSpeedScale;
                team.setSpeed();

                this.SuperTimeLeft = settings.SuperDashDurationTime;
                break;

            case SuperList.superTackle:
                MyDebug.Log("Tackle Super attack !");
                team.tackleFactor = game.settings.Global.Super.superTackleBoxScale;
                team.setSpeed();
                break;

            case SuperList.superStun:
                MyDebug.Log("Stun Super attack !");
                team.opponent.StunEverybodyForSeconds(settings.SuperStunDurationTime);

                this.SuperTimeLeft = settings.SuperStunDurationTime;
                break;

            default:
                break;
        }

        //LauchFeedBack(super);
    }
Beispiel #39
0
 public void PlaySuperParticleSystem(SuperList super, bool play)
 {
     this.PlaySuperParticleSystem(play);
 }
Beispiel #40
0
 void StopFeedBack(SuperList super)
 {
     team.PlaySuperParticleSystem(super, false);
 }