Example #1
0
        public override bool Equals(object obj)
        {
            if (!base.Equals(obj))
            {
                return(false);
            }
            AttackEvent other = (AttackEvent)obj;

            return(robotId == other.robotId && locs.Equals(other.locs));
        }
Example #2
0
        internal virtual List <GameEvent> Attack(byte dir, bool isPrimary)
        {
            if (position.Equals(Map.NULL_VEC))
            {
                return(new List <GameEvent>());
            }
            AttackEvent evt = new AttackEvent();

            evt.locs    = GetVictimLocations(dir);
            evt.robotId = id;
            if (isPrimary)
            {
                evt.primaryBatteryCost = GameConstants.DEFAULT_ATTACK_POWER;
            }
            else
            {
                evt.secondaryBatteryCost = GameConstants.DEFAULT_ATTACK_POWER;
            }
            return(new List <GameEvent>()
            {
                evt
            });
        }