public AssumeIdentity(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "trickster_hfid": Trickster = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                case "identity_id": property.Known = true; Identity = HistoricalFigure.Unknown; break;     // TODO Bad ID, so unknown for now.

                case "target_enid": Target = world.GetEntity(Convert.ToInt32(property.Value)); break;

                case "trickster": if (Trickster == null)
                    {
                        Trickster = world.GetHistoricalFigure(Convert.ToInt32(property.Value));
                    }
                    else
                    {
                        property.Known = true;
                    } break;

                case "target": if (Target == null)
                    {
                        Target = world.GetEntity(Convert.ToInt32(property.Value));
                    }
                    else
                    {
                        property.Known = true;
                    } break;
                }
            }

            Trickster.AddEvent(this);
            Identity.AddEvent(this);
            Target.AddEvent(this);
        }
Exemple #2
0
        public AssumeIdentity(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "identity_id":
                    IdentityId = Convert.ToInt32(property.Value);
                    break;

                case "target_enid":
                    Target = world.GetEntity(Convert.ToInt32(property.Value));
                    break;

                case "identity_histfig_id":
                case "identity_nemesis_id":
                case "trickster_hfid":
                case "trickster":
                    if (Trickster == null)
                    {
                        Trickster = world.GetHistoricalFigure(Convert.ToInt32(property.Value));
                    }
                    else
                    {
                        property.Known = true;
                    }
                    break;

                case "target":
                    if (Target == null)
                    {
                        Target = world.GetEntity(Convert.ToInt32(property.Value));
                    }
                    else
                    {
                        property.Known = true;
                    }
                    break;

                case "identity_name":
                    IdentityName = property.Value;
                    break;

                case "identity_race":
                    IdentityRace = world.GetCreatureInfo(property.Value);
                    break;

                case "identity_caste":
                    IdentityCaste = string.Intern(Formatting.InitCaps(property.Value.ToLower().Replace('_', ' ')));
                    break;
                }
            }

            Trickster.AddEvent(this);
            Target.AddEvent(this);
            if (!string.IsNullOrEmpty(IdentityName))
            {
                Identity = new Identity(IdentityName, IdentityRace, IdentityCaste);
            }
        }