public void SelectOtherTile(SelectTile tileToSelect) { if (_currentConfiguration.TileSets.Count > 0) { _selectedTile = tileToSelect == SelectTile.Previous ? -1 : +1; _selectedTile = UnityEngine.Mathf.Clamp(_selectedTile, 0, _currentConfiguration.TileSets.Count - 1); } }
/// <summary> /// Initializes the dictionary object. /// </summary> /// <returns>Commands dictionary.</returns> private static Dictionary <string, IGameCommand> InitializeList() { Dictionary <string, IGameCommand> list = new Dictionary <string, IGameCommand>(); IGameCommand loginCommand = new Login(); list.Add(loginCommand.Name, loginCommand); IGameCommand getPlayerCommand = new GetPlayersList(); list.Add(getPlayerCommand.Name, getPlayerCommand); IGameCommand selectPlayerCommand = new SelectPlayer(); list.Add(selectPlayerCommand.Name, selectPlayerCommand); IGameCommand uiLoadCompleteCommand = new UILoadComplete(); list.Add(uiLoadCompleteCommand.Name, uiLoadCompleteCommand); IGameCommand updateScoreCommand = new UpdateScore(); list.Add(updateScoreCommand.Name, updateScoreCommand); IGameCommand gameCompleteCommand = new GameComplete(); list.Add(gameCompleteCommand.Name, gameCompleteCommand); IGameCommand sendJigSawCoordinates = new SendJigSawCoordinates(); list.Add(sendJigSawCoordinates.Name, sendJigSawCoordinates); IGameCommand selectTile = new SelectTile(); list.Add(selectTile.Name, selectTile); IGameCommand disableTile = new DisableTile(); list.Add(disableTile.Name, disableTile); IGameCommand assignTile = new AssignTile(); list.Add(assignTile.Name, assignTile); IGameCommand resetTile = new ResetTile(); list.Add(resetTile.Name, resetTile); return(list); }
public TileEditorManager(ContentManager Content, PlanetLevel inputLevel, GameWindow gameWindow) { State = "Loading"; var baseSize = Content.Load <Texture2D>(@"Tileset/Earth/Tile_Earth_Wall"); this.baseSize = baseSize.Width; hud = new SelectionHUD(Content); layoutCam = new Camera2D(gameWindow); //input = new EditorInput(baseSize.Width); render = new RenderLevel(_textureManager); select = new SelectTile(this.baseSize); planetLevel = inputLevel; State = "Rendering"; }
public TileEditorManager( ContentManager Content, SpriteBatch spriteBatch, TextureManager textureManager, GameWindow gameWindow) { _textureManager = textureManager; _spriteBatch = spriteBatch; State = "Loading"; var baseSize = _textureManager.Wall; this.baseSize = baseSize.Width; hud = new SelectionHUD(Content); layoutCam = new Camera2D(gameWindow); render = new RenderLevel(_textureManager); select = new SelectTile(this.baseSize); layoutCam.Pos = planetLevel.SetToMiddle(planetLevel); State = "Rendering"; }