コード例 #1
0
        public void WhenOnRobotDeathIsCalled()
        {
            _deadRobotName = RandomHelper.RandomRobotName();
            var e = new RobotDeathEvent(_deadRobotName);

            _brain.OnRobotDeath(e);
        }
コード例 #2
0
 public override void OnRobotDeath(RobotDeathEvent evnt)
 {
     if (Targets.ContainsKey(evnt.Name))
     {
         Targets[evnt.Name].Live = false;
     }
 }
コード例 #3
0
 public override void OnRobotDeath(RobotDeathEvent deadRobot)
 {
     if (deadRobot.Name == Enemy.Name)
     {
         Enemy.Clear();
     }
 }
コード例 #4
0
ファイル: myRobot.cs プロジェクト: jhanna60/Johnny5Robot
 public override void OnRobotDeath(RobotDeathEvent e)
 {
     if (e.Name == target.name)
     {
         target.distance = 10000; //this will effectively make us search for a new target
     }
 }
コード例 #5
0
 public override void OnRobotDeath(RobotDeathEvent e)
 {
     if (e.Name == target.name)
     {
         target = null;
     }
 }
コード例 #6
0
 public override void OnRobotDeath(RobotDeathEvent evnt)
 {
     if (HasEnemy() && evnt.Name == Enemy.Name)
     {
         Enemy.Clear();
     }
 }
コード例 #7
0
 public override void OnRobotDeath(RobotDeathEvent evnt)
 {
     base.OnRobotDeath(evnt);
     SetTurnRadarRightRadians(360);
     blackBoard.CurrentEnemy = null;
     currentBehaviour        = pushBehaviour;
     Execute();
 }
コード例 #8
0
 /// <summary>
 ///     If a robot dies, resets back to scanning
 /// </summary>
 /// <param name="bot"></param>
 public override void OnRobotDeath(RobotDeathEvent bot)
 {
     if (bot.Name == _currentTarget)
     {
         switchState(BotState.Scanning);
         _currentTarget = string.Empty;
     }
 }
コード例 #9
0
ファイル: AIRobot.cs プロジェクト: Casey-Hofland/Kernmodule-3
 public override void OnRobotDeath(RobotDeathEvent evnt)
 {
     for (int i = 0; i < behaviors.Count; ++i)
     {
         var behavior = behaviors[i];
         behavior.OnRobotDeath(evnt);
     }
 }
コード例 #10
0
 public static void Action(NagibatorTank me, RobotDeathEvent e)
 {
     Console.WriteLine($"{nameof(OnRobotDeathModule)}: {e.Name}");
     if (me.Target?.Equals(e.Name) == true)
     {
         me.Target = null;
         Console.WriteLine($"{nameof(OnRobotDeathModule)}: Set target to NULL");
     }
 }
コード例 #11
0
 public override void OnRobotDeath(RobotDeathEvent e)
 {
     _enemies.Remove(e.Name);
     if (_battleStrategy.CurrentTarget != null)
     {
         if (e.Name.Equals(_battleStrategy.CurrentTarget?.Name))
         {
             _battleStrategy.ResetTarget();
         }
     }
 }
コード例 #12
0
ファイル: BorderGuard.cs プロジェクト: daijunjian/robocode
        /// <summary>
        /// This method is called by the game whenever another robot dies.
        /// </summary>
        /// <param name="robotDeathEvent">The robot death event containing data about the robot that died.</param>
        public override void OnRobotDeath(RobotDeathEvent robotDeathEvent)
        {
            // Remove the scanned robot data for the robot that died.
            // This data is useless now, and will only confuse our robot if it stays in our scanned robot data.
            scannedRobotData.Remove(robotDeathEvent.Name);

            // Remove our global target, if our target was the robot that died, but only if we have a current target
            if (target != null && target.name.Equals(robotDeathEvent.Name))
            {
                target = null;
            }
        }
コード例 #13
0
ファイル: HiHuc_DA.cs プロジェクト: ltduy/hihuc
        public override void OnRobotDeath(RobotDeathEvent evnt)
        {
            base.OnRobotDeath(evnt);
            var _enemyCount = EnemyCount();
            var _teamCount  = TeamCount();
            var _turn       = 2;

            if (((_enemyCount <= _turn && _teamCount <= _enemyCount) || (_teamCount <= _enemyCount && _teamCount <= _turn)) && !(Stragegy is Solo))
            {
                // Big boss come last
                Stragegy = new Solo(this);
                Stragegy.Init();
            }
        }
コード例 #14
0
        public override void OnRobotDeath(RobotDeathEvent evnt)
        {
            base.OnRobotDeath(evnt);

            // TL go first
            var _enemyCount = EnemyCount();
            var _teamCount  = TeamCount();
            var _turn       = 4;

            if (((_enemyCount <= _turn && _teamCount <= _enemyCount) || (_teamCount <= _enemyCount && _teamCount <= _turn)) && !(Stragegy is Solo))
            {
                Stragegy = new Solo(this);
                Stragegy.Init();
            }
        }
コード例 #15
0
        public override void OnRobotDeath(RobotDeathEvent evnt)
        {
            Console.WriteLine("Died: " + evnt.Name);
            if (TargetEnemyName == evnt.Name || LastBulletHit?.Name == evnt.Name)
            {
                if (robots.ContainsKey(evnt.Name))
                {
                    robots.Remove(evnt.Name);
                }

                LastBulletHit   = null;
                TargetEnemyName = null;

                CurrentPhase = RoboPhase.WallRush;
            }

            base.OnRobotDeath(evnt);
        }
コード例 #16
0
ファイル: BorderGuard.cs プロジェクト: youssouf0123/robocode
        /// <summary>
        /// This method is called by the game when another robot dies.
        /// </summary>
        /// <param name="robotDeathEvent">The robot death event containing data about the robot that died.</param>
        public override void OnRobotDeath(RobotDeathEvent robotDeathEvent)
        {
            // Gets the name of the robot that died
            var deadRobotName = robotDeathEvent.Name;

            // Remove the robot data for the robot that died from the enemy dictionary and access list
            enemyDictionary.Remove(deadRobotName);
            accessedEnemyList.Remove(deadRobotName);

            // Remove the data entry for the oldest scanned robot, if we have such an entry
            if (oldestScanned != null && oldestScanned.name.Equals(deadRobotName))
            {
                oldestScanned = null;
            }
            if (target != null && target.name.Equals(deadRobotName))
            {
                target = null;
            }
        }
コード例 #17
0
 public override void OnRobotDeath(RobotDeathEvent evnt)
 {
 }
コード例 #18
0
 public override void OnRobotDeath(RobotDeathEvent e) => OnRobotDeathModule.Action(this, e);
コード例 #19
0
 public void OnRobotDeath(RobotDeathEvent evnt)
 {
     _context.OnRobotDeath(evnt.Name);
 }
コード例 #20
0
 public override void OnRobotDeath(RobotDeathEvent evnt)
 {
     _brain.OnRobotDeath(evnt);
 }
コード例 #21
0
 public override void OnRobotDeath(RobotDeathEvent e)
 {
     enemyCount--;
 }
コード例 #22
0
 public virtual void OnRobotDeath(RobotDeathEvent evnt)
 {
     _myRobot.OnRobotDeath(evnt);
 }
コード例 #23
0
 public void OnRobotDeath(RobotDeathEvent evnt)
 {
     count(evnt);
 }
コード例 #24
0
 public override void OnRobotDeath(RobotDeathEvent e)
 {
     map.removeTarget(e.Name);
 }
コード例 #25
0
 public virtual void OnRobotDeath(RobotDeathEvent evnt)
 {
 }
コード例 #26
0
 public override void OnRobotDeath(RobotDeathEvent e)
 {
     //WriteQFunctionToFile();
     base.OnRobotDeath(e);
 }
コード例 #27
0
 protected virtual void OnRobotDeath(RobotDeathEvent e)
 {
 }
コード例 #28
0
ファイル: Tailer.cs プロジェクト: kolauy/robocode
 public override void OnRobotDeath(RobotDeathEvent evnt)
 {
     _algorithm.RemoveDeadRobot(evnt.Name);
 }
コード例 #29
0
        public override void OnRobotDeath(RobotDeathEvent e)
        {
            Enemy en = ((Enemy)(this.targets[e.Name]));

            en.live = false;
        }
コード例 #30
0
        /// <summary>
        /// Handle robot death event.
        /// </summary>
        /// <param name="evnt"></param>
        /// <inheritdoc/>
        public override void OnRobotDeath(RobotDeathEvent evnt)
        {
            var name = evnt.Name;

            this.enemies.Remove(name);
        }