static void Main(string[] args) { ObjectsList obj = new ObjectsList("ObjectsList.txt"); List <ObjectData> test = new List <ObjectData>(); Grid g = new Grid(); g.tiles[3, 3].AddItem(1); g.tiles[2, 4].AddItem(2); g.tiles[2, 4].AddItem(1); Renderer render = new Renderer(g); render.RenderUI(); Console.WriteLine(g.tiles[3, 3].Objects.ElementAt(0).Name); Console.WriteLine(); }
public void AddItem(int ID) { ObjectsList tmpList = new ObjectsList("ObjectsList.txt"); switch (tmpList.GetObjInfo(ID).type) { case "Weapon": Objects.Push(new Weapon(tmpList.GetObjInfo(ID), this.X, this.Y)); break; case "NPC": Objects.Push(new NPC(tmpList.GetObjInfo(ID), this.X, this.Y)); break; case "Food": Objects.Push(new Food(tmpList.GetObjInfo(ID), this.X, this.Y)); break; } }
static void Main(string[] args) { Random random = new Random(); ObjectsList obj = new ObjectsList("ObjectsList.txt"); List <ObjectData> test = new List <ObjectData>(); Grid g = new Grid(); Player player = new Player(0, random.Next(0, 8)); GameLoop gameLoop = new GameLoop(); g.tiles[player.X, player.Y].Objects.Push(player); Renderer render = new Renderer(player, g, gameLoop); InputManager input = new InputManager(player, g, render, gameLoop, g.map); while (gameLoop.inGame) { gameLoop.Loop(player, g); g.UpdateKnownPlaces(player); switch (gameLoop.State) { case "Start": render.RenderStartScreen(); input.StartScreenCommand(); break; case "Game": render.RenderUI(); input.TurnCommand(); break; case "Credits": render.RenderCredits(); input.CreditCommands(); break; } } }