Пример #1
0
 private void HandleEnemyData(XElement e, ref EAgentRole role)
 {
     foreach (var el in e.Elements())
     {
         if (el.Name.ToString().Equals("Threat"))
         {
             var threat = EThreat.None;
             foreach (var ele in el.Elements())
             {
                 if (EnumUtil <EThreat> .TryGetEnumValue(ele.Name.ToString(), ref threat))
                 {
                     this._threats.EnemyThreatTable[role][threat] = double.Parse(ele.Value);
                 }
             }
         }
         else if (el.Name.ToString().Equals("Vuln"))
         {
             var vuln = EVuln.None;
             foreach (var ele in el.Elements())
             {
                 if (EnumUtil <EVuln> .TryGetEnumValue(ele.Name.ToString(), ref vuln))
                 {
                     this._vulns.EnemyVulnTable[role][vuln] = double.Parse(ele.Value);
                 }
             }
         }
     }
 }
Пример #2
0
 private void HandleRole(XElement el, ref EAgentRole role)
 {
     if (EnumUtil <EAgentRole> .TryGetEnumValue(el.Name.ToString(), ref role))
     {
         this._agentSelfMod.ThreatTable.Add(role, new Dictionary <EThreat, double>());
         this._agentSelfMod.VulnTable.Add(role, new Dictionary <EVuln, double>());
         this._threats.EnemyThreatTable.Add(role, new Dictionary <EThreat, double>());
         this._threats.FriendlyThreatTable.Add(role, new Dictionary <EThreat, double>());
         this._vulns.EnemyVulnTable.Add(role, new Dictionary <EVuln, double>());
         this._vulns.FriendlyVulnTable.Add(role, new Dictionary <EVuln, double>());
     }
     foreach (var ele in el.Elements())
     {
         if (ele.Name.ToString().Equals("Enemy"))
         {
             this.HandleEnemyData(ele, ref role);
         }
         else if (ele.Name.ToString().Equals("Degradation"))
         {
             this.HandleDegradationData(ele, ref role);
         }
         else if (ele.Name.ToString().Equals("Friendly"))
         {
             this.HandleFriendlyData(ele, ref role);
         }
         else if (ele.Name.ToString().Equals("Self"))
         {
             this.HandleSelfData(ele, ref role);
         }
     }
 }
        private void HandleAbilities(XElement el, ref EAgentRole role)
        {
            var ability = EAbility.None;

            foreach (var ele in el.Elements())
            {
                if (EnumUtil <EAbility> .TryGetEnumValue(ele.Name.ToString(), ref ability))
                {
                    this._orientAbilities.Table[role][ability] = double.Parse(ele.Value);
                }
            }
        }
 private void HandleRole(XElement el, ref EAgentRole role)
 {
     if (EnumUtil <EAgentRole> .TryGetEnumValue(el.Name.ToString(), ref role))
     {
         this._orientAbilities.Table.Add(role, new Dictionary <EAbility, double>());
     }
     foreach (var ele in el.Elements())
     {
         if (ele.Name.ToString().Equals("Abilities"))
         {
             this.HandleAbilities(ele, ref role);
         }
     }
 }
Пример #5
0
 private void HandleDegradationData(XElement e, ref EAgentRole role)
 {
     foreach (var el in e.Elements())
     {
         if (el.Name.ToString().Equals("Threat"))
         {
             this._degradation.ThreatTable.Add(role, double.Parse(el.Value));
         }
         else if (el.Name.ToString().Equals("Vuln"))
         {
             this._degradation.VulnTable.Add(role, double.Parse(el.Value));
         }
     }
 }
Пример #6
0
        public MAgentRole GetAgentRole(EAgentRole role)
        {
            MAgentRole agentRole;

            switch (role)
            {
            case (EAgentRole.Assassin_Melee): { agentRole = new MAssassinMelee(EAgentRole.Assassin_Melee); } break;

            case (EAgentRole.Assassin_Ranged): { agentRole = new MAssassinRanged(EAgentRole.Assassin_Ranged); } break;

            case (EAgentRole.Brawler_Initiater): { agentRole = new MBrawlerInitiater(EAgentRole.Brawler_Initiater); } break;

            case (EAgentRole.Support_Summoner): { agentRole = new MSupportSummoner(EAgentRole.Support_Summoner); } break;

            case (EAgentRole.Support_Weenbower): { agentRole = new MSupportWeenbower(EAgentRole.Support_Weenbower); } break;

            case (EAgentRole.Tank_Zone): { agentRole = new MTankZone(EAgentRole.Tank_Zone); } break;

            default: { agentRole = null; } break;
            }
            return(agentRole);
        }
Пример #7
0
        private void GenerateParticlePoints(EAgentRole role, MTile tile, bool lTeam)
        {
            var    particles      = tile.GetParticles();
            double particlePoints = 0;

            var enemyVulns      = this._vulns.EnemyVulnTable[role];
            var enemyThreats    = this._threats.EnemyThreatTable[role];
            var friendlyVulns   = this._vulns.FriendlyVulnTable[role];
            var friendlyThreats = this._threats.FriendlyThreatTable[role];

            foreach (var kvp in enemyThreats)
            {
                particlePoints -= (particles.GetThreatValue(kvp.Key, lTeam) * kvp.Value);
            }
            foreach (var kvp in enemyVulns)
            {
                double points = (particles.GetVulnValue(kvp.Key, lTeam) * kvp.Value);
                points         *= tile.GetVulnMod();
                particlePoints += points;
            }
            foreach (var kvp in friendlyThreats)
            {
                double points = (particles.GetThreatValue(kvp.Key, lTeam) * kvp.Value);
                points         *= tile.GetThreatMod();
                particlePoints += points;
            }
            foreach (var kvp in friendlyVulns)
            {
                particlePoints += (particles.GetVulnValue(kvp.Key, lTeam) * kvp.Value);
            }
            var tileAndWeight = new AgentMoveTileAndWeight();

            tileAndWeight.Tile   = tile;
            tileAndWeight.Weight = particlePoints;
            this._tiles.Add(tileAndWeight);
        }
Пример #8
0
 public MSupportSummoner(EAgentRole role) : base(role)
 {
 }
Пример #9
0
 public MSupportWeenbower(EAgentRole role) : base(role)
 {
 }
Пример #10
0
 public MBrawlerInitiater(EAgentRole role) : base(role)
 {
 }
Пример #11
0
 public MAssassinRanged(EAgentRole role) : base(role)
 {
 }
Пример #12
0
 public MAssassinMelee(EAgentRole role) : base(role)
 {
 }
Пример #13
0
 public void SetAIRole(EAgentRole role)
 {
     this._aiRole = role;
 }
Пример #14
0
 public MAgentRole(EAgentRole type)
 {
     this._type = type;
 }