Exemplo n.º 1
0
        public void Randomness()


        {
            race raceTime = new race();

            int actual = Factory.Number();

            Assert.IsTrue(actual > 1 && actual <= 20);
        }
 public Character(string name, race race, int strength, int dexterity, int constitution, int intelligence, int wisdom, int charisma)
 {
     this.Name         = name;
     this.Race         = race;
     this.Strength     = strength;
     this.Dexterity    = dexterity;
     this.Constitution = constitution;
     this.Intelligence = intelligence;
     this.Wisdom       = wisdom;
     this.Charisma     = charisma;
 }
Exemplo n.º 3
0
        public void Dragon()


        {
            race raceTime = new race();

            int ID = 2;

            int actual = Convert.ToInt16(Factory.GetADragon(ID).Dragon);

            Assert.IsTrue(actual > 1 && actual <= 3);
        }
Exemplo n.º 4
0
        public tournament CreateRaceInTournament(int s, string tr, List <string> pos)//string p1, string p2, string p3, string p4, string p5, string p6, string p7, string p8, string p9, string p10, string fl)
        {
            //int lastid = db.races.ToList().Last().id;
            result     r  = CreateResult(pos);
            race       rc = db.races.Where(e => e.location.Equals(tr)).FirstOrDefault();
            tournament t  = new tournament();

            t.race   = rc.id;
            t.result = r.id;
            t.season = s;
            db.tournaments.Add(t);
            db.SaveChanges();
            return(t);
        }
 /// <summary>
 /// Конструктор неизменяемых полей
 /// </summary>
 public RPG_Character(string Name, race Race, bool Sex, uint MaxHP = 100, uint Expirience = 0)
 {
     this.Name = Name;
     race_type = Race;
     isMale    = Sex;
     ID        = nextID;
     nextID++;
     this.MaxHP      = MaxHP;
     currentHP       = MaxHP;
     this.Expirience = Expirience;
     IsTalkative     = true;
     IsWalkable      = true;
     Hit            += HitHandler;
     //Invetory = new List<Item>();
 }
Exemplo n.º 6
0
        private static void AddResult(ExcelWorksheet workSheet, int row, int col, int runnerId, Model1 db)
        {
            // var d = RaceDetails.GetMetersByName(workSheet.Cells[row, col].Value.ToString());
            var d        = RaceDetails.GetMetersByCode(workSheet.Cells[row, col].Value.ToString());
            var distance = workSheet.Cells[row, col].Value;
            var time     = workSheet.Cells[row, col + 1].Value.ToString();



            string output = new string(time.Where(c => (Char.IsDigit(c) || c == '.' || c == ':')).ToArray());

            string   SubString    = output.Substring(output.Length - 8);
            TimeSpan ts           = TimeSpan.Parse(SubString);
            double   totalSeconds = ts.TotalSeconds;
            int      seconds      = Convert.ToInt32(totalSeconds);

            ClassLibrary1.race Arace = new race();
            Arace.runner   = runnerId;
            Arace.distance = d;
            Arace.time     = seconds;

            db.races.Add(Arace);
            db.SaveChanges();
        }
Exemplo n.º 7
0
 public CharacterWieldingMagic(string Name, race Race, bool Sex, uint MaxHP = 100, uint Expirience = 0, uint maxMP = 100)
     : base(Name, Race, Sex, MaxHP, Expirience)
 {
     this.MaxMP = maxMP;
     currentMP  = maxMP;
 }