コード例 #1
0
        public AttackEvent(FireOrder fo, GameFormationActor source, FormationDistanceGraph distanceGraph, int percentileRoll = PercentileNotRolled, int exchange = 0, int volley = 0)
            : base("Attack Event", exchange, volley)
        {
            var distance = distanceGraph.GetOrEstablishDistance(source.GetFormationId(), fo.TargetID);

            this.Description              = "Attack Event";
            this.TargetingData            = new TargetingData(source, distance, fo.Priority, fo.DiceAssigned, fo.FireType);
            this.UnitAssignmentPercentile = percentileRoll;

            // Just to avoid any confusion
            this.TargetingData.TargetUnitPercentileRoll = percentileRoll;
        }
コード例 #2
0
        public AttackEvent(FireOrder fo, GameFormationActor source, GameFormationActor target, FormationDistanceGraph distanceGraph, int exchange = 0, int volley = 0, int percentileRoll = PercentileNotRolled)
            : base("Attack Event", exchange, volley)
        {
            var distance = distanceGraph.GetOrEstablishDistance(source.GetFormationId(), target.GetFormationId());

            if (target.GetFormationId() != fo.TargetID)
            {
                throw new InvalidOperationException(
                          $"FireOrder specified target formation [{fo.TargetID}]{fo.TargetFormationName} " +
                          $"but target Formation argument in AttackEvent is [{target.GetFormationId()}]{target.GetFormationName()}");
            }

            this.TargetingData            = new TargetingData(source, target, distance, fo.Priority, fo.DiceAssigned, fo.FireType);
            this.UnitAssignmentPercentile = percentileRoll;
        }