using System; using System.Collections.Generic; using System.Linq; using System.Text; using VBXSE; namespace LD31 { public enum TileType { Void, Grass } public class Tile : TileOrObject { public static Dictionary baseTiles; public Tile() { name = "Void"; spriteName = "void"; } public Tile(string name) { if (baseTiles.ContainsKey(name)) { Tile baseTile = baseTiles[name]; this.name = baseTile.name; this.possibleSprites = baseTile.possibleSprites; this.spriteName = possibleSprites[Main.random.Next(possibleSprites.Length)]; this.sprite = Main.CreateSprite(spriteName); //Copy properties for (int i = 0; i < baseTile.properties.Count; i++) { this.properties.Add(baseTile.properties[i]); } //Copy scripts this.useScript = baseTile.useScript; foreach (KeyValuePair kp in baseTile.combinationScripts) { this.combinationScripts.Add(kp.Key, kp.Value); } foreach (KeyValuePair kp in baseTile.namedScripts) { this.namedScripts.Add(kp.Key, kp.Value); } } } } }