Ejemplo n.º 1
0
        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 }
            };
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 public TileSet(TileSet copy)
     : base(copy)
 {
     TileTypes = new List<String>(copy.TileTypes);
 }
Ejemplo n.º 4
0
 public void SetTileSet(TileSet tileSet, ClickEventHandler onClick = null)
 {
     SetTileSet(tileSet, Width, onClick);
 }