Commit 5bf518cf authored by NEBOIT Jean-Charles's avatar NEBOIT Jean-Charles
Browse files

Finished TP1

parent f08581b0
......@@ -35,6 +35,20 @@ namespace BusinessLayer
return list.Select(c => "PV -> " + c.PV + ", Type -> " + c.Type + ", Bravoury -> " + c.Bravoury + ", Crazyness -> " + c.Crazyness).ToList();
}
public List<String> CharactersList()
{
List<Character> list = DalManager.CharactersList();
return list.Select(c => c.FirstName + " " + c.LastName).ToList();
}
public List<String> CharactersList(int BravourySup, int PVSup)
{
List<Character> list = DalManager.CharactersList();
return list.Where(c => c.Characteristics.Bravoury > BravourySup && c.Characteristics.PV > PVSup).Select(c => c.FirstName + " " + c.LastName).ToList();
}
public List<String> TerritoryList()
{
List<Territory> list = DalManager.TerritoriesList();
......
......@@ -80,12 +80,12 @@ namespace StubDataAccessLayer
}
return res;
}
public List<CharacterType> CharactersList()
public List<Character> CharactersList()
{
List<CharacterType> newListe = new List<CharacterType>();
foreach (CharacterType character in CharacterType.GetValues(typeof(CharacterType)))
newListe.Add(character);
return newListe;
List<Character> res = new List<Character>();
foreach (Character character in _characterList)
res.Add(character);
return res;
}
public List<Characteristics> CharactersCharacteristicsList()
{
......
......@@ -13,23 +13,41 @@ namespace ThronesTournamentConsole
public void DisplayHouses()
{
Console.WriteLine("---- Display Houses ----");
List<String> _listHouse = businessLayer.HousesList();
for (int k = 0; k < _listHouse.Count(); k++)
Console.WriteLine(_listHouse[k]);
}
public void DisplayHouses(int n)
public void DisplayHouses(int sup)
{
List<String> _listHouse = businessLayer.HousesList(n);
Console.WriteLine("---- Display Houses with Units > " + sup + " ----");
List<String> _listHouse = businessLayer.HousesList(sup);
for (int k = 0; k < _listHouse.Count(); k++)
Console.WriteLine(_listHouse[k]);
}
public void DisplayCharacteristics()
{
Console.WriteLine("---- Display Characteristics ----");
foreach (String s in businessLayer.CharactersCharacteristicsList())
Console.WriteLine(s);
}
public void DisplayCharacters()
{
Console.WriteLine("---- Display Characters ----");
foreach (String s in businessLayer.CharactersList())
Console.WriteLine(s);
}
public void DisplayCharacters(int BravourySup, int PVSup)
{
Console.WriteLine("---- Display Characters with Bravoury > " + BravourySup + " and Pv > " + PVSup + " ----");
foreach (String s in businessLayer.CharactersList(BravourySup, PVSup))
Console.WriteLine(s);
}
public void DisplayTerritories()
{
Console.WriteLine("---- Display Territories ----");
List<String> terr = businessLayer.TerritoryList();
for (int k = 0; k < terr.Count(); k++)
Console.WriteLine(terr[k]);
......@@ -38,10 +56,13 @@ namespace ThronesTournamentConsole
static void Main(string[] args)
{
Program game = new Program();
game.DisplayHouses();
game.DisplayHouses(200);
game.DisplayCharacteristics();
game.DisplayTerritories();
game.DisplayCharacters();
game.DisplayCharacters(30, 50);
Console.ReadKey();
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment