Exemplo n.º 1
0
        public static Monster GetMonsterByID(int id)
        {
            HerosDataTableAdapters.CreaturesTableAdapter adapter = new HerosDataTableAdapters.CreaturesTableAdapter();

            HerosData.CreaturesDataTable dt = new HerosData.CreaturesDataTable();

            adapter.FillByCreatureID(dt, id);

            Monster monster = new Monster(

                (int)dt[0][0],
                (string)dt[0][1],
                (string)dt[0][2],
                (int)dt[0][3],
                (int)dt[0][4],
                (int)dt[0][5],
                (int)dt[0][6],
                (int)dt[0][7],
                (CreatureType)(int)dt[0][8],
                (CreatureClass)(int)dt[0][9],
                (int)dt[0][10],
                (int)dt[0][11]
                );

            return(monster);
        }
Exemplo n.º 2
0
        public static List <Monster> GetCreaturebyTypeDifficulty(int type, int difficulty)
        {
            HerosDataTableAdapters.CreaturesTableAdapter adapter = new HerosDataTableAdapters.CreaturesTableAdapter();

            HerosData.CreaturesDataTable dt = new HerosData.CreaturesDataTable();

            adapter.FillByTypeDifficulty(dt, type, difficulty);

            List <Monster> monster = new List <Monster>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                monster.Add(new Monster((int)dt[i][0], (string)dt[i][1], (string)dt[i][2], (int)dt[i][3], (int)dt[i][4], (int)dt[i][5], (int)dt[i][6],
                                        (int)dt[i][7], (CreatureType)(int)dt[i][8], (CreatureClass)(int)dt[i][9], (int)dt[i][10], (int)dt[i][11]));
            }

            return(monster);
        }