Example #1
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);
    }
Example #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();
        }
Example #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();
        }
Example #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);
        }
Example #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);
        }
Example #10
0
        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);
        }
Example #11
0
        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!");
        }
Example #13
0
        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);
        }
Example #14
0
        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);
        }
Example #15
0
        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);
        }
Example #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());
        }
Example #18
0
        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]);
        }
Example #19
0
        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);
        }
Example #20
0
        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);
        }
Example #21
0
        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);
        }
Example #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);
    }
Example #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);
 }
Example #24
0
        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);
        }
Example #25
0
        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]);
            }
        }
Example #26
0
        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);
        }
Example #27
0
        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);
        }
Example #28
0
        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);
        }
Example #30
0
        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++;
            }
        }
Example #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);
        }
Example #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);
    }
Example #33
0
 //Team "State Machine"
 public virtual bool OnSuper(Team t, SuperList super)
 {
     return (false);
 }
Example #34
0
 public void event_Super(Team t, SuperList super)
 {
     foreach (State tmp in list)
     {
         if (tmp.OnSuper(t, super))
             return;
     }
 }
Example #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;
 }
Example #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;
 }
Example #37
0
 void LauchFeedBack(SuperList super)
 {
     team.PlaySuperParticleSystem(super, true);
 }
Example #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);
    }
Example #39
0
 public void PlaySuperParticleSystem(SuperList super, bool play)
 {
     this.PlaySuperParticleSystem(play);
 }
Example #40
0
 void StopFeedBack(SuperList super)
 {
     team.PlaySuperParticleSystem(super, false);
 }