public ActorType(pActorType a) { switch (a.Owner) { case "Hostile": this.owner = ScoringDB.ActorInfo.OwnerInfo.OwnerType.HostileDM; break; case "Friendly": this.owner = ScoringDB.ActorInfo.OwnerInfo.OwnerType.FriendlyDM; break; case "This": this.owner = ScoringDB.ActorInfo.OwnerInfo.OwnerType.Myself; break; default: throw new ApplicationException("Scoring rule contains unknown actor specifier " + a.Owner); } if ("Any" == a.Id) { this.id = new ScoringDB.ActorInfo.IdentifierInfo(ScoringDB.ActorInfo.IdentifierInfo.IdentifierType.Any, a.Id); } else if (NameLists.speciesNames.ContainsKey(a.Id)) { this.id = new ScoringDB.ActorInfo.IdentifierInfo(ScoringDB.ActorInfo.IdentifierInfo.IdentifierType.Species, a.Id);; } else if (NameLists.unitNames.ContainsKey(a.Id)) { this.id = new ScoringDB.ActorInfo.IdentifierInfo(ScoringDB.ActorInfo.IdentifierInfo.IdentifierType.Instance, a.Id);; } else { throw new ApplicationException("Unknown scoring rule identifier " + a.Id); } if (null != a.Region) { this.region = new ScoringLocationType(a.Region); } else { List <string> anywhere = new List <string>(); anywhere.Add("Anywhere"); this.region = new ScoringLocationType(anywhere, ScoringDB.ActorInfo.LocationInfo.LocationType.Anywhere); } }
public ActorType(pActorType a) { switch (a.Owner) { case "Hostile": this.owner = ScoringDB.ActorInfo.OwnerInfo.OwnerType.HostileDM; break; case "Friendly": this.owner = ScoringDB.ActorInfo.OwnerInfo.OwnerType.FriendlyDM; break; case "This": this.owner = ScoringDB.ActorInfo.OwnerInfo.OwnerType.Myself; break; default: throw new ApplicationException("Scoring rule contains unknown actor specifier " + a.Owner); } if ("Any" == a.Id) { this.id = new ScoringDB.ActorInfo.IdentifierInfo(ScoringDB.ActorInfo.IdentifierInfo.IdentifierType.Any, a.Id); } else if (NameLists.speciesNames.ContainsKey(a.Id)) { this.id = new ScoringDB.ActorInfo.IdentifierInfo(ScoringDB.ActorInfo.IdentifierInfo.IdentifierType.Species, a.Id); ; } else if (NameLists.unitNames.ContainsKey(a.Id)) { this.id = new ScoringDB.ActorInfo.IdentifierInfo(ScoringDB.ActorInfo.IdentifierInfo.IdentifierType.Instance, a.Id); ; } else { throw new ApplicationException("Unknown scoring rule identifier " + a.Id); } if (null != a.Region) { this.region = new ScoringLocationType(a.Region); } else { List<string> anywhere = new List<string>(); anywhere.Add("Anywhere"); this.region = new ScoringLocationType(anywhere, ScoringDB.ActorInfo.LocationInfo.LocationType.Anywhere); } }