예제 #1
0
 TransportHandler(TransportHandler _transporthandler)
 {
     transporterList = new List <Transporter>();
     foreach (Transporter trans in _transporthandler.transporterList)
     {
         transporterList.Add(trans.Copy());
     }
     FlagDublicateExits();
     FlagDuplicateEntrances();
 }
예제 #2
0
        // 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);
        }
예제 #3
0
        // 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;
        }