public Level( int width, int height) { _Width = width; _Height = height; _LevelSize = width * height; _Theme = "default"; _TileSet = StorageManagement.StorageManagement.getTileset(_Theme); LevelName = ""; LevelPublisher = ""; SoundLocation = ""; MusicLocation = ""; TheseusLocation = 0; MinotaurLocation = width - 2; LocalHighScore = new SerialDict<string, int>(); }
public Level(int width, int height) { _Width = width; _Height = height; _LevelSize = width * height; _Theme = "default"; _TileSet = StorageManagement.StorageManagement.getTileset(_Theme); LevelName = ""; LevelPublisher = ""; SoundLocation = ""; MusicLocation = ""; TheseusLocation = 0; MinotaurLocation = width - 2; LocalHighScore = new SerialDict <string, int>(); }
public Level(string newLevelName, string newPublisher, int newRating, decimal newAvgTime, SerialDict<string, string> newTileSet, string newSounds, string newMusic, List<int> newCells, int newWidth, int newHeight, int newHighscore, SerialDict<string,int> newLocalHighscore, int newTheseusLocation, int newMinotaurLocation, int newExitLocation, string newTheme) { LevelName = newLevelName; LevelPublisher = newPublisher; Rating = newRating; AvgTime = newAvgTime; TileSet = newTileSet; SoundLocation = newSounds; MusicLocation = newMusic; CellCollection = this.CreateCells(newCells); _Theme = newTheme; Width = newWidth; Height = newHeight; LocalHighScore = newLocalHighscore; TheseusLocation = newTheseusLocation; MinotaurLocation = newMinotaurLocation; ExitLocation = newExitLocation; }
public Level(string newLevelName, string newPublisher, int newRating, decimal newAvgTime, SerialDict <string, string> newTileSet, string newSounds, string newMusic, List <int> newCells, int newWidth, int newHeight, int newHighscore, SerialDict <string, int> newLocalHighscore, int newTheseusLocation, int newMinotaurLocation, int newExitLocation, string newTheme) { LevelName = newLevelName; LevelPublisher = newPublisher; Rating = newRating; AvgTime = newAvgTime; TileSet = newTileSet; SoundLocation = newSounds; MusicLocation = newMusic; CellCollection = this.CreateCells(newCells); _Theme = newTheme; Width = newWidth; Height = newHeight; LocalHighScore = newLocalHighscore; TheseusLocation = newTheseusLocation; MinotaurLocation = newMinotaurLocation; ExitLocation = newExitLocation; }
public void LoadTextures() { //var foo = ConnectionPortStyles.GetPortStyle("tex"); ValueConnectionKnobAttribute outKnobAttribs = new ValueConnectionKnobAttribute("Output", Direction.Out, typeof(Texture), NodeSide.Bottom); var texStyle = ConnectionPortStyles.GetPortStyle(outKnobAttribs.StyleID); this.TimedDebug("texStyleID: " + outKnobAttribs.StyleID, 2); texStyle.SetColor(Color.yellow); textures = new List <Texture2D>(Resources.LoadAll <Texture2D>("StaticTextures")); if (texKnobs == null) { texKnobs = new SerialDict <string, ValueConnectionKnob>(); } if (texNames == null) { texNames = new List <string>(); } List <string> loadedValues = new List <string>(textures.Select(t => t.name)); HashSet <string> removedValues = new HashSet <string>(texNames); removedValues.ExceptWith(loadedValues); HashSet <string> addedValues = new HashSet <string>(loadedValues); addedValues.ExceptWith(texNames); //Rewire connection ports from loaded strings foreach (string texName in texNames) { texKnobs[texName] = (ValueConnectionKnob)dynamicConnectionPorts[texNames.IndexOf(texName)]; } //Remove any ports for textures that were removed foreach (string texName in removedValues) { dynamicConnectionPorts.Remove(texKnobs[texName]); } // Add ports for any textures that were added foreach (string texName in addedValues) { texKnobs[texName] = CreateValueConnectionKnob(outKnobAttribs); texNames.Add(texName); } }
public static void saveTileset(SerialDict<string, string> tileSet, string file) { Filer.saveToFile(tileSet, file); }
public static SerialDict<string, string> getTileset(string name) { SerialDict<string, string> tileset = new SerialDict<string, string>(); tileset = (SerialDict<string, string>)Filer.loadFromFile(tileset.GetType(), storageLocation + "XML/Tilesets/" + name); return tileset; }