예제 #1
0
        static void Main(string[] args)
        {
            Transport ts1 = new Bactrian("Двугорбый верблюд", 10, 30);
            Transport ts2 = new AllTerainBoots("Ботинки-вездеходы", 6, 60);
            Transport ts3 = new CamelSpeedBoat("Верблюд-быстроход", 40, 10);
            Transport ts4 = new Centaur("Кентавр", 15, 8);
            Transport ts5 = new MyLand("MeLand", 10, 10, 5);
            Transport ts6 = new Broom("Метла", 20);
            Transport ts7 = new FlyCarpet("Ковер-самолет", 10);
            Transport ts8 = new Mortar("Ступа", 8);
            Transport ts9 = new MyAir("MeAir", 100, 50);

            List <Transport> ts = new List <Transport>();

            ts.Add(ts1);
            ts.Add(ts2);
            ts.Add(ts3);
            ts.Add(ts4);
            ts.Add(ts5);
            ts.Add(ts6);
            ts.Add(ts7);
            ts.Add(ts8);
            ts.Add(ts9);

            AllTsRace race   = new AllTsRace(1000, ts);
            Transport first  = race.Champion();
            string    actual = first.Name;

            Console.WriteLine(actual);
        }
예제 #2
0
        public void TestLand()
        {
            //arrange


            //act
            string    expected = "Ботинки-вездеходы";
            Transport ts1      = new Bactrian("Двугорбый верблюд", 10, 30);
            Transport ts2      = new AllTerainBoots("Ботинки-вездеходы", 6, 60);
            Transport ts3      = new CamelSpeedBoat("Верблюд-быстроход", 40, 10);
            Transport ts4      = new Centaur("Кентавр", 15, 8);
            Transport ts5      = new MyLand("MeLand", 10, 10, 5);

            List <Transport> ts = new List <Transport>();

            ts.Add(ts1);
            ts.Add(ts2);
            ts.Add(ts3);
            ts.Add(ts4);
            ts.Add(ts5);
            Race <Transport> race   = new Race <Transport>(1000, ts);
            Transport        first  = race.Champion();
            string           actual = first.Name;

            Assert.AreEqual(expected, actual);
            //assert ожидали - получили
        }
예제 #3
0
        public List <Embed> GetMembersList(MyLand land, SocketGuild guild)
        {
            var    embs = new List <Embed>();
            string temp = $"**Członkowie**: *{land.Name}*\n\n";

            foreach (var user in guild.Users.Where(x => x.Roles.Any(r => r.Id == land.Underling)))
            {
                if (temp.Length + user.Mention.Length > 2000)
                {
                    embs.Add(new EmbedBuilder()
                    {
                        Color       = EMType.Info.Color(),
                        Description = temp
                    }.Build());
                    temp = $"{user.Mention}\n";
                }
                else
                {
                    temp += $"{user.Mention}\n";
                }
            }

            embs.Add(new EmbedBuilder()
            {
                Color       = EMType.Info.Color(),
                Description = temp
            }.Build());

            return(embs);
        }
예제 #4
0
        public void TestMyLand(string name, int speed, int rest, int timeChill, double answer)
        {
            double    expected = answer;
            Transport ts       = new MyLand(name, speed, rest, timeChill);
            double    actual   = ts.Result(1000);

            Assert.AreEqual(expected, actual);
        }
예제 #5
0
        public EmbedBuilder GetMembersList(MyLand land, SocketGuild guild)
        {
            string valueString = "";

            foreach (var user in guild.Users.Where(x => x.Roles.Any(r => r.Id == land.Underling)))
            {
                valueString += $"{user.Mention}\n";
            }

            return(new EmbedBuilder
            {
                Title = $"Członkowie: {land.Name}".TrimToLength(EmbedBuilder.MaxTitleLength),
                Description = valueString.TrimToLength(1700)
            });
        }
예제 #6
0
    public override void CalcSpellCoolTime(Spell _spell)
    {
        base.CalcSpellCoolTime(_spell);
        switch (_spell.spellEntry)
        {
        case 1:    //이동스킬
        {
            Unit taget = MainTarget;
            if (!taget)
            {
                return;
            }
            if (_spell.CanReach(taget.MyLand))
            {
                _spell.SpellCast(taget.MyLand);
            }
            else
            {
                _spell.SpellCast(MyLand.AstarAlg(taget.MyLand));
            }
        }
        break;

        default:
        {
            Unit taget = MainTarget;
            if (!taget)
            {
                return;
            }
            if (_spell.CanReach(taget.MyLand))
            {
                _spell.SpellCast(taget.MyLand);
            }
        }
        break;
        }
    }
예제 #7
0
    protected override void Start()
    {
        uiHpbar.maxValue    = MaxHP;
        uiHpbar.RecentValue = MaxHP;
        recentHP            = MaxHP;
        uiHpbar.Stop        = true;

        uiSteminabar.maxValue    = state.maxStemina;
        uiSteminabar.RecentValue = 0.0f;
        recentStemina            = 0.0f;
        uiSteminabar.Stop        = true;

        Debug.Log(transform.name + "스펠추가");
        for (int i = 0; i < state.spellEntryList.Length; i++)
        {
            if (state.spellEntryList[i] == 0)
            {
                break;
            }
            Spell spell = Instantiate(SpellManager.instance.SpellResearch(state.spellEntryList[i])).GetComponent <Spell>();
            spellList[i]      = spell;
            spell.spellCaster = this;
        }

        ReCheckThreatList();

        Welber = Instantiate(WelberPrefab.GetComponent <Unit>());
        Vector3 Pos   = new Vector3(0.0f, 0.0f, -0.5f);
        Vector3 Scale = transform.localScale;

        Welber.transform.SetParent(MyLand.transform);
        Welber.transform.localPosition = Pos;
        Welber.transform.localScale    = Scale;
        Welber.MoveLand(MyLand.NearLand(0, 1));
        Welber.Faction  = 1;
        Welber.playable = false;
        Welber.CharacterSpriteTurnRight(false);
    }
예제 #8
0
        public void TestLandAndAir()
        {
            //arrange


            //act
            string    expected = "MeAir";
            Transport ts1      = new Bactrian("Двугорбый верблюд", 10, 30);
            Transport ts2      = new AllTerainBoots("Ботинки-вездеходы", 6, 60);
            Transport ts3      = new CamelSpeedBoat("Верблюд-быстроход", 40, 10);
            Transport ts4      = new Centaur("Кентавр", 15, 8);
            Transport ts5      = new MyLand("MeLand", 10, 10, 5);
            Transport ts6      = new Broom("Метла", 20);
            Transport ts7      = new FlyCarpet("Ковер-самолет", 10);
            Transport ts8      = new Mortar("Ступа", 8);
            Transport ts9      = new MyAir("MeAir", 100, 50);

            List <Transport> ts = new List <Transport>();

            ts.Add(ts1);
            ts.Add(ts2);
            ts.Add(ts3);
            ts.Add(ts4);
            ts.Add(ts5);
            ts.Add(ts6);
            ts.Add(ts7);
            ts.Add(ts8);
            ts.Add(ts9);

            Race <Transport> race   = new Race <Transport>(1000, ts);
            Transport        first  = race.Champion();
            string           actual = first.Name;

            Assert.AreEqual(expected, actual);
            //assert ожидали - получили
        }