private void AddMainMenu() { var objects = new Dictionary <string, IObjectUi>(); // рандомная штука для заглушки var background = new GameObjectUi <int>(0, false, false); background.LoadTexture(content, "textures/back_matmeh"); objects.Add("background", background); // пока рандомный плеер для заглушки var mainMenu = new Scene(objects, new Player("")); scenes.Add(Scenes.MainMenu, mainMenu); }
private Dictionary <string, IObjectUi> GetUI() { var objects = new Dictionary <string, IObjectUi>(); var uiSample = new GameObjectUi <GameObject>(null, false, true); uiSample.LoadTexture(content, "textures/Interface/leftUI"); uiSample.Name = "uiL"; uiSample.Coordinates = new Vector2(0, 0); objects.Add("uiL", uiSample); var uiSample2 = new GameObjectUi <GameObject>(null, false, true); uiSample2.LoadTexture(content, "textures/Interface/rightUI"); uiSample2.Name = "uiR"; uiSample2.Coordinates = new Vector2(game.Window.ClientBounds.Width - 200, 0); objects.Add("uiR", uiSample2); return(objects); }
private void AddUniver() { // берем текущую игру, загружаем из локации "univer" все лог. объекты, // создаем для них граф. представление и закрепляем текстуру с соотв. именем var objects = new Dictionary <string, IObjectUi>(); var background = new GameObjectUi <GameObject>(null, false, false); background.LoadTexture(content, "textures/Univer/back_matmeh"); background.Name = "background"; background.Coordinates = new Vector2(0, offsetY); objects.Add("background", background); foreach (var gameObj in GameUI.CurrentLogicalGame.Map.Univer.Entities) { var sprite = new GameObjectUi <GameObject>(gameObj, true, false); System.Console.WriteLine($"textures/{gameObj.Name}"); sprite.LoadTexture(content, $"textures/Univer/{gameObj.Name}"); sprite.LoadFlashedTexture(content, $"textures/Univer/{gameObj.Name}Enable"); sprite.Name = gameObj.Name; objects.Add(gameObj.Name, sprite); } //добавим интерфейс var allObjects = objects.Union(GetUI()).ToDictionary(x => x.Key, x => x.Value); //добавим игрока var currentPlayer = GameUI.CurrentLogicalGame.Player; var playerUi = new GameObjectUi <Player>(currentPlayer, false, false); playerUi.LoadTexture(content, "textures/Actor/gg_move/Right/GG_right"); playerUi.Name = "player"; allObjects.Add("player", playerUi); var univer = new Scene(allObjects, currentPlayer); //лучше заменить на добычу координат из xml как и путей до текстур PlaceObjectsOnScreenUniver(univer, offsetY); scenes.Add(Scenes.Univer, univer); }