Esempio n. 1
0
 public Voting(Arena arena, int time, ref ArenaManager arenaManager)
 {
     Arena        = arena;
     EndTime      = time;
     ArenaManager = arenaManager;
     TimeStart    = DateTime.Now;
     Maps         = new List <Map> {
         Arena.Map
     };
     Votes = new List <Vote>();
     arenaManager.GetPlayersInArena(arena).ForEach(plr =>
                                                   plr.SendInfoMessage("Map vote started! Use /vote for map vote or add new in vote."));
 }
Esempio n. 2
0
        private void OnInitialize(EventArgs args)
        {
            Config     = Config.Read(Path.Combine(TShock.SavePath, "[PvpArena]-Config.json"));
            MapManager = new MapManager(Path.Combine(TShock.SavePath, "[PvpArena]-Maps"));
            IDbConnection db = GetDbConnection();

            if (db == null)
            {
                Dispose(true);
                return;
            }
            ArenaManager = new ArenaManager(db, ref MapManager);
            ParamManager = new ParamManager(ref ArenaManager, ref MapManager);
            GetDataHandlers.PlayerUpdate += ParamManager.OnPlayerUpdate;
            GetDataHandlers.TogglePvp    += ParamManager.OnTogglePvp;
            Commands.ChatCommands.Add(new Command(Permissions.MapUse, MapCmd, "map"));
            Commands.ChatCommands.Add(new Command(Permissions.ArenaUse, ArenaCmd, "arena"));
            Commands.ChatCommands.Add(new Command(Permissions.VoteUse, VoteCmd, "vote"));
        }
Esempio n. 3
0
 public ParamManager(ref ArenaManager arenaManager, ref MapManager mapManager)
 {
     ArenaManager = arenaManager;
     MapManager   = mapManager;
     Votings      = new List <Voting>();
 }