コード例 #1
0
        public WRS_SpectatingClient()
        {
            CConfiguration config = new CConfiguration();
            config.uri = uri;

            configuration = new JConfiguration(config.SendCommand());
            if (!configuration.IsValid) throw new Exception("Fehler beim Verbinden. Empfangene Configuration nicht gültig");

            httpTimer = new System.Timers.Timer();
            httpTimer.Interval = (double)refreshHttpInterval;
            httpTimer.Elapsed += httpTimer_Elapsed;
            httpTimer.Enabled = true;
        }
コード例 #2
0
ファイル: AICore.cs プロジェクト: Boris0190/WRS20
        public void Start()
        {
            //String teamName = "HelloKittyStorm" + DateTime.Now.Ticks.ToString();
            String teamName = "HelloKittyStorm";

            CConfiguration cConfig = new CConfiguration();
            cConfig.uri = uri;
            config = new JConfiguration(cConfig.SendCommand());

            CTeam cTeam = new CTeam();
            cTeam.TeamName = teamName;
            cTeam.uri = uri;
            team = new JTeam(cTeam.SendCommand());

            Task.Factory.StartNew(() => ThinkTask());
        }
コード例 #3
0
ファイル: AIShip.cs プロジェクト: Boris0190/WRS20
        public AIShip(String uri, Guid teamPrivateKey, JConfiguration config)
        {
            String shipName = "Kittay!" + CurrentID.ToString();
            this.uri = uri;
            this.teamPrivateKey = teamPrivateKey;
            this.config = config;

            CSpawn cSpawn = new CSpawn();
            cSpawn.uri = uri;
            cSpawn.ShipName = shipName;
            cSpawn.TeamPrivateKey = teamPrivateKey;
            spawn = new JSpawn(cSpawn.SendCommand());

            currRadarCommand = new CRadar();
            currRadarCommand.uri = uri;
            currRadarCommand.ShipPrivateKey = spawn.ShipPrivateKey;

            radarTimer.Interval = config.MinRadarInterval + 10; //todo +10 ist unsauber. evtl iwie anders machen
            radarTimer.Elapsed += radarTimer_Elapsed;
            radarTimer.Start();
        }