private LevelutionHandler(LevelutionHandler _levelutionHandler, int _sizePerCell) { leverList = new List <Lever>(); sizePerCell = _sizePerCell; foreach (Lever lev in _levelutionHandler.leverList) { leverList.Add(lev.Copy()); } outlines = new List <LeverOutlines>(); foreach (Lever lever in leverList) { outlines.Add(new LeverOutlines(lever, _sizePerCell)); } }
// all variables initialized here need to be initialized in the copyconstructor too public Level(String mapfile, int sizePerCell, Vector2i position, int _keysToUnlock) { SafelyInitializeStrings(); map = new Map(mapfile, sizePerCell); player = new Player(position, map); itemList = new ItemList(map); trapHandler = new TrapHandler(map); List <MapManipulation> list = new List <MapManipulation>(); keysToUnlock = _keysToUnlock; ratingNumbers = mapFromText.getRatingNumbersFromMap(mapfile); // deletes all items from map AFTER they have been saved in the itemList // to simplify the placing of items without cluttering the map with extra blocks map.RemoveAllItems(); map.RemoveAllTraps(); levelution = mapFromText.getLevelutionHandler(mapfile, map); transporterHandler = mapFromText.getTransFromMap(mapfile, map); }
// Constructor for the Copy function public Level(Map _map, Player _player, ItemList _itemList, TrapHandler _trapHandler, LevelutionHandler _levelution, TransportHandler _transporter, int _playerScore, int _keysToUnlock, int[] _ratingNumbers) { SafelyInitializeStrings(); map = _map; player = _player; itemList = _itemList; trapHandler = _trapHandler; keysToUnlock = _keysToUnlock; levelution = _levelution; transporterHandler = _transporter; this.setScoreCounter(_playerScore); ratingNumbers = _ratingNumbers; guiScoreNumber.CharacterSize = 50; guiScore.CharacterSize = 18; guiLevelNumber.CharacterSize = 50; guiLevel.CharacterSize = 18; }