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.")); }
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")); }
public ParamManager(ref ArenaManager arenaManager, ref MapManager mapManager) { ArenaManager = arenaManager; MapManager = mapManager; Votings = new List <Voting>(); }