Ejemplo n.º 1
0
        public static ArenaSetting Load(string path)
        {
            ArenaSetting asetting = new ArenaSetting();

            if (File.Exists(path))
            {
                FileStream stream = File.OpenRead(path);
                asetting = (ArenaSetting)serializer.Deserialize(stream);
                stream.Close();
            }
            else
            {
                asetting.Save(path);
            }

            return(asetting);
        }
Ejemplo n.º 2
0
        public override void Initialize()
        {
            tPulse  = (TPulse)PlugInHandler.GetPluginByType(typeof(TPulse));
            Setting = ArenaSetting.Load(ArenaSettingFile);
            //todo

            //commands
            tPulse.Commands.ChatCommands.Add(new Command("", SetPrepare, "asetprepare"));
            tPulse.Commands.ChatCommands.Add(new Command("", SetTeamStart, "asetstart"));
            tPulse.Commands.ChatCommands.Add(new Command("", PreparePlayers, "aprepare"));
            tPulse.Commands.ChatCommands.Add(new Command("", AssignPlayerTeam, "aassign"));
            tPulse.Commands.ChatCommands.Add(new Command("", ResetTeams, "areset"));
            tPulse.Commands.ChatCommands.Add(new Command("", SetArenaHall, "asethall"));
            tPulse.Commands.ChatCommands.Add(new Command("", SetAterMatch, "asetroom"));

            Hooks.GameHooks.Update += new Action(GameHooks_Update);

            //Team Color
            //Console.WriteLine(Main.teamColor.Length);
            Main.teamColor[1] = Color.Blue;
            Main.teamColor[2] = Color.Pink;
        }
Ejemplo n.º 3
0
        public override void Initialize()
        {
            tPulse = (TPulse)PlugInHandler.GetPluginByType(typeof(TPulse));
            Setting = ArenaSetting.Load(ArenaSettingFile);
            //todo

            //commands
            tPulse.Commands.ChatCommands.Add(new Command("", SetPrepare, "asetprepare"));
            tPulse.Commands.ChatCommands.Add(new Command("", SetTeamStart, "asetstart"));
            tPulse.Commands.ChatCommands.Add(new Command("", PreparePlayers, "aprepare"));
            tPulse.Commands.ChatCommands.Add(new Command("", AssignPlayerTeam, "aassign"));
            tPulse.Commands.ChatCommands.Add(new Command("", ResetTeams, "areset"));
            tPulse.Commands.ChatCommands.Add(new Command("", SetArenaHall, "asethall"));
            tPulse.Commands.ChatCommands.Add(new Command("", SetAterMatch, "asetroom"));

            Hooks.GameHooks.Update += new Action(GameHooks_Update);

            //Team Color
            //Console.WriteLine(Main.teamColor.Length);
            Main.teamColor[1] = Color.Blue;
            Main.teamColor[2] = Color.Pink;
        }
Ejemplo n.º 4
0
        public static ArenaSetting Load(string path)
        {
            ArenaSetting asetting = new ArenaSetting();

            if(File.Exists(path))
            {

                FileStream stream = File.OpenRead(path);
                asetting = (ArenaSetting)serializer.Deserialize(stream);
                stream.Close();
            }
            else
            {
                asetting.Save(path);
            }

            return asetting;
        }