protected override Dictionary<String, Object> OnValidate() { Boolean typeIsValid = TypeTextBox.TextBox.TextIsValid(); Boolean tileSetIsValid = CurrentTileList.Count > 0; if (!typeIsValid || !tileSetIsValid) { List<String> errorMessages = new List<String>(); if (!typeIsValid) errorMessages.Add(InformationDialogBox.Instance.GetTypeErrorStr()); if (!tileSetIsValid) errorMessages.Add("Wrong TileSet !"); CallInformationDialogBox(InformationDialogBox.EType.Error, errorMessages.ToArray()); return base.OnValidate(); } TileSet tileSet = new TileSet(); tileSet.SetType(TypeTextBox.TextBox.Text); foreach (Tile tile in CurrentTileList) { if (TextureMode) { tile.Texture.ToScript(); tile.ToScript(); } tileSet.AddTileType(tile.Type); } return new Dictionary<String, Object>() { { "TileSet", tileSet } }; }
void SetTileSet(TileSet tileSet, Int32 tileSetWidth, ClickEventHandler onClick = null) { if (tileSet == null) return; MultiBox.SetSize(tileSetWidth); CurrentTileSet = tileSet; List<Tile> tiles = new List<Tile>(); for (Int32 count = 0; count < tileSet.GetTileTypeCount(); ++count) tiles.Add(tileSet.GetTileAt(count)); SetTileSet(tiles, tileSetWidth, onClick); }
public TileSet(TileSet copy) : base(copy) { TileTypes = new List<String>(copy.TileTypes); }
public void SetTileSet(TileSet tileSet, ClickEventHandler onClick = null) { SetTileSet(tileSet, Width, onClick); }