예제 #1
0
        public void setBaseDataset()
        {
            var gimliDwarf = new Dwarf(
                "Gimli",
                140,
                new List <Weapon>()
            {
                new Weapon("Axt", 12),
                new Weapon("Schwert", 15)
            });

            var gumliDwarf = new Dwarf(
                "Gumli",
                163,
                new List <Weapon>()
            {
                new Weapon("Axt", 17)
            });

            var zwingliDwarf = new Dwarf(
                "Zwingli",
                70,
                new List <Weapon>()
            {
                new Weapon("Zauberstab", 45),
                new Weapon("Streithammer", 15)
            });

            var altobardenTribe = new Tribe(
                "Altobarden",
                1247,
                new List <Dwarf>()
            {
                gimliDwarf,
                zwingliDwarf
            },
                gimliDwarf,
                25);

            var elbknechteTribe = new Tribe(
                "Elbknechte",
                1023,
                new List <Dwarf>()
            {
                gumliDwarf
            });

            tribeList.Add(elbknechteTribe);
            tribeList.Add(altobardenTribe);
        }
예제 #2
0
        public bool setLeader(Dwarf dwarf, int leadsince)
        {
            if (!(this.leadsince != 0 && this.leadsince > leadsince))
            {
                this.leadsince = leadsince;
            }
            else
            {
                return(false);
            }

            if (dwarfList.Contains(dwarf))
            {
                this.leader = dwarf.name;
            }
            else
            {
                return(false);
            }

            return(true);
        }
예제 #3
0
 public void removeDwarf(Dwarf dwarf)
 {
     dwarfList.Remove(dwarf);
 }
예제 #4
0
 public void addDwarf(Dwarf dwarf)
 {
     dwarfList.Add(dwarf);
 }