예제 #1
0
        public override Level CreateLevel(string name)
        {
            Level level = new MobHuntLevel(name);

            level.Initialize();
            return(level);
        }
예제 #2
0
        public override bool Interact(Level currentLevel, Player player, BlockCoordinates blockCoordinates, BlockFace face)
        {
            Sign signEntity = currentLevel.GetBlockEntity(blockCoordinates) as Sign;
            if (signEntity == null) return false;

            string world = signEntity.Text1;

            if (player.Level.LevelId.Equals(world)) return true;

            if (!Worlds.ContainsKey(player.Level.LevelId))
            {
                Worlds.Add(player.Level.LevelId, player.Level);
            }

            if (!Worlds.ContainsKey(world))
            {
                var mobHuntLevel = new MobHuntLevel(world, new FlatlandWorldProvider());
                mobHuntLevel.Initialize();
                Worlds.Add(world, mobHuntLevel);
            }

            Level level = Worlds[world];
            player.SpawnLevel(level);
            level.BroadcastTextMessage(string.Format("{0} teleported to world <{1}>.", player.Username, level.LevelId));

            return true;
        }
예제 #3
0
        public override bool Interact(Level currentLevel, Player player, BlockCoordinates blockCoordinates, BlockFace face)
        {
            Sign signEntity = currentLevel.GetBlockEntity(blockCoordinates) as Sign;

            if (signEntity == null)
            {
                return(false);
            }

            string world = signEntity.Text1;

            if (player.Level.LevelId.Equals(world))
            {
                return(true);
            }

            if (!Worlds.ContainsKey(player.Level.LevelId))
            {
                Worlds.Add(player.Level.LevelId, player.Level);
            }


            if (!Worlds.ContainsKey(world))
            {
                var mobHuntLevel = new MobHuntLevel(world, new FlatlandWorldProvider());
                mobHuntLevel.Initialize();
                Worlds.Add(world, mobHuntLevel);
            }

            Level level = Worlds[world];

            player.SpawnLevel(level);
            level.BroadcastTextMessage(string.Format("{0} teleported to world <{1}>.", player.Username, level.LevelId));

            return(true);
        }
예제 #4
0
 public override Level CreateLevel(string name)
 {
     Level level = new MobHuntLevel(name);
     level.Initialize();
     return level;
 }