コード例 #1
0
ファイル: Name.cs プロジェクト: read-and-code/Stone
        public void LookupForAssignment(SymbolTable symbolTable)
        {
            EntityLocation entityLocation = symbolTable.Put(this.Value);

            this.Nest  = entityLocation.Nest;
            this.Index = entityLocation.Index;
        }
コード例 #2
0
        // returnerer et initial state for hver agent hvor bokse og mål er fordelt
        private static List <WorldState> AssignBoxesToAgentsNew(List <EntityLocation> agents, List <EntityLocation> boxes, List <EntityLocation> agentGoals, List <EntityLocation> boxGoals, HashSet <Location> walls)
        {
            List <WorldState> initialSates = new List <WorldState>();
            WorldState        newState;

            foreach (var agent in agents)
            {
                newState          = new WorldState();
                newState.agent    = (Agent)agent.Entity;
                newState.Walls    = walls;
                newState.timeStep = 0;
                newState.Parent   = null;

                //If there is an agentgoal for this agent set it..
                if (agentGoals.Any(a => a.Entity.Equals(newState.agent)))
                {
                    EntityLocation agentGoal = agentGoals.First(a => a.Entity.Equals(newState.agent));
                    newState.agentGoal   = agentGoal.Location;
                    newState.isAgentGoal = true;
                }
                else
                {
                    newState.agentGoal   = null;
                    newState.isAgentGoal = false;
                }
                initialSates.Add(newState);
            }

            //foreach box
            //assign it to the agent of same colour with smallest amount of assigned boxes so far.



            return(initialSates);
        }
コード例 #3
0
            public Resident(BasePlayer player) : base(player.GetEntity())
            {
                if (player == null)
                {
                    return;
                }

                user_id     = player.userID;
                name        = player.displayName;
                prefab_path = player.PrefabName;
                prefab_id   = player.prefabID;
                prefab_name = player.ShortPrefabName;
                is_npc      = player.IsNpc;
                health      = player.health;

                is_building_authed  = player.IsBuildingAuthed();
                is_building_blocked = player.IsBuildingBlocked();
                team     = new ResidentTeamMembership(player.Team);
                location = new EntityLocation(player.transform);

                if (player.metabolism != null)
                {
                    if (player.metabolism.heartrate != null)
                    {
                        heart_rate = player.metabolism.heartrate.value;
                    }
                }
            }
コード例 #4
0
ファイル: Physics.cs プロジェクト: namezis/DragonSpire
        internal EntityLocation Velocity;         //Were just using this to hold the three dimensional velocity vector

        internal Physics(EntityLocation location, Entity owner, PhysicsType type)
        {
            Owner = owner;
            PType = type;

            Velocity    = new EntityLocation(owner.world);
            Location    = location;
            OldLocation = location;
        }
コード例 #5
0
ファイル: World.cs プロジェクト: yvanoff/nitrosharp
 public EntityRec(
     Entity entity,
     EntityGroup group,
     EntityLocation location)
 {
     Entity   = entity;
     Group    = group;
     Location = location;
 }
コード例 #6
0
        public override EntityLocation Put(string key)
        {
            EntityLocation entityLocation = this.GetEntityLocation(key, 0);

            if (entityLocation == null)
            {
                return(new EntityLocation(this.MemberType, this.Add(key)));
            }
            else
            {
                return(entityLocation);
            }
        }
コード例 #7
0
ファイル: Name.cs プロジェクト: read-and-code/Stone
        public override void Lookup(SymbolTable symbolTable)
        {
            EntityLocation entityLocation = symbolTable.GetEntityLocation(this.Value);

            if (entityLocation == null)
            {
                throw new StoneException(string.Format("Undefined name: {0}", this.Value), this);
            }
            else
            {
                this.Nest  = entityLocation.Nest;
                this.Index = entityLocation.Index;
            }
        }
コード例 #8
0
        public ClassBuilderBase GetClassBuilder(EntityLocation entitylocation)
        {
            if (!string.IsNullOrEmpty(entitylocation.Id) && _classBuilderDictionary.ContainsKey(entitylocation.Id))
            {
                return(_classBuilderDictionary[entitylocation.Id]);
            }
            var type         = BuilderManager.Get(entitylocation.Overridekey, DefaultBuilderConstants.ClassBuilder);
            var classBuilder = BuilderManager.InitializeBuilder <ClassBuilderBase>(type, new object[] { _entity, entitylocation });

            var id = entitylocation.Id ?? "LocationId" + _classBuilderDictionary.Count + 1;

            _classBuilderDictionary.Add(id, classBuilder);
            return(classBuilder);
        }
コード例 #9
0
        public void GetEntityLocation_ReferenceWithAlias_MatchesExpected()
        {
            var target   = new DataAnnotationsDefinitionProvider();
            var expected = new EntityLocation(
                typeof(MultiReferenceRow),
                typeof(MultiReferenceRow).GetCustomAttribute <TableAttribute>()?.Schema ?? typeof(MultiReferenceRow).Namespace,
                typeof(MultiReferenceRow).GetCustomAttribute <TableAttribute>()?.Name ?? nameof(MultiReferenceRow),
                false,
                "CreatedBy");

            var actual = target.GetEntityLocation(
                new EntityReference
            {
                ContainerType = null,
                EntityType    = typeof(MultiReferenceRow),
                EntityAlias   = "CreatedBy"
            });

            Assert.AreEqual(expected, actual, string.Join(Environment.NewLine, expected.GetDifferences(actual)));
        }
コード例 #10
0
            public Entity(BaseEntity entity)
            {
                if (entity == null)
                {
                    return;
                }

                owner_id = entity.OwnerID;
                name     = entity.name;
                type     = entity.GetType()?.Name;
                if (type == null)
                {
                    type = "unknown";
                }

                prefab_id   = entity.prefabID;
                prefab_name = entity.ShortPrefabName;
                prefab_path = entity.PrefabName;

                location = new EntityLocation(entity.transform);
                is_npc   = entity.IsNpc;
            }
コード例 #11
0
 /// <inheritdoc />
 public string GetPhysicalName(EntityLocation location)
 {
     return($"{this.Escape(location.Container)}.{this.Escape(location.Name)}");
 }
コード例 #12
0
 /// <inheritdoc />
 public string Qualify(EntityAttributeDefinition attribute, EntityLocation entityLocation)
 {
     return($"{this.GetEntityCanonicalName(entityLocation)}.{this.GetAttributeCanonicalName(attribute)}");
 }
コード例 #13
0
 /// <summary>
 /// Gets an object property referenced by the entity location.
 /// </summary>
 /// <param name="baseObject">
 /// The base object.
 /// </param>
 /// <param name="entityLocation">
 /// The entity location.
 /// </param>
 /// <returns>
 /// The related entity as an <see cref="object"/>.
 /// </returns>
 private static object GetObjectProperty(object baseObject, EntityLocation entityLocation)
 {
     return(baseObject.GetType().GetProperty(entityLocation.Alias ?? entityLocation.Name)?.GetMethod.Invoke(baseObject, null));
 }
コード例 #14
0
        public static CommunityDisplayProperties Community(this CommunityDisplayProperties displayProperties, int package, EntityLocation location)
        {
            CommunityDisplayProperties communityDisplayProperty = displayProperties;

            communityDisplayProperty = communityDisplayProperty.CommunityDefault(package);
            switch (location)
            {
            case EntityLocation.Search:
            {
                communityDisplayProperty.Address          = OptionsResolver.IsActive(package, "Mslc.Ui.Search.Community.Address");
                communityDisplayProperty.Featured         = OptionsResolver.IsActive(package, "Mslc.Ui.Search.Community.Featured");
                communityDisplayProperty.Name             = OptionsResolver.IsActive(package, "Mslc.Ui.Search.Community.Name");
                communityDisplayProperty.Price            = OptionsResolver.IsActive(package, "Mslc.Ui.Search.Community.Price");
                communityDisplayProperty.PhotoCount       = OptionsResolver.IsActive(package, "Mslc.Ui.Search.Community.PhotoCount");
                communityDisplayProperty.Image            = OptionsResolver.IsActive(package, "Mslc.Ui.Search.Community.Image");
                communityDisplayProperty.Bathes           = OptionsResolver.IsActive(package, "Mslc.Ui.Search.Community.Bathes");
                communityDisplayProperty.Beds             = OptionsResolver.IsActive(package, "Mslc.Ui.Search.Community.Beds");
                communityDisplayProperty.Area             = OptionsResolver.IsActive(package, "Mslc.Ui.Search.Community.Area");
                communityDisplayProperty.Amenities        = OptionsResolver.IsActive(package, "Mslc.Ui.Search.Community.Amenities");
                communityDisplayProperty.AdditionalImages = OptionsResolver.IsActive(package, "Mslc.Ui.Search.Community.AdditionalImages");
                communityDisplayProperty.Phone            = OptionsResolver.IsActive(package, "Mslc.Ui.Search.Community.Phone");
                communityDisplayProperty.FloorPlans       = OptionsResolver.IsActive(package, "Mslc.Ui.Search.Community.QuickView.FloorPlans");
                communityDisplayProperty.SpecHomes        = OptionsResolver.IsActive(package, "Mslc.Ui.Search.Community.QuickView.SpecHomes");
                communityDisplayProperty.Homes            = OptionsResolver.IsActive(package, "Mslc.Ui.Search.Community.QuickView.Homes");
                communityDisplayProperty.LeadForm         = OptionsResolver.IsActive(package, "Mslc.Ui.Search.Community.LeadForm");
                communityDisplayProperty.Map       = OptionsResolver.IsActive(package, "Mslc.Ui.Search.Community.QuickView.Map");
                communityDisplayProperty.QuickView = OptionsResolver.IsActive(package, "Mslc.Ui.Search.Community.QuickView");
                break;
            }

            case EntityLocation.QuickView:
            {
                communityDisplayProperty.Address           = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.Community.Address");
                communityDisplayProperty.Name              = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.Community.Name");
                communityDisplayProperty.Price             = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.Community.Price");
                communityDisplayProperty.PhotoCount        = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.Community.PhotoCount");
                communityDisplayProperty.Image             = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.Community.Image");
                communityDisplayProperty.Bathes            = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.Community.Bathes");
                communityDisplayProperty.Beds              = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.Community.Beds");
                communityDisplayProperty.Area              = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.Community.Area");
                communityDisplayProperty.Amenities         = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.Community.Amenities");
                communityDisplayProperty.AdditionalImages  = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.Community.AdditionalImages");
                communityDisplayProperty.Phone             = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.Community.Phone");
                communityDisplayProperty.Description       = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.Community.Description");
                communityDisplayProperty.CommunityServices = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.Community.CommunityServices");
                communityDisplayProperty.LeadForm          = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.Community.LeadForm");
                communityDisplayProperty.PhotoTour         = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.Community.PhotoTour");
                break;
            }

            case EntityLocation.FeaturedWidget:
            {
                communityDisplayProperty.Address    = OptionsResolver.IsActive(package, "Mslc.Ui.FeaturedWidget.Community.Address");
                communityDisplayProperty.Name       = OptionsResolver.IsActive(package, "Mslc.Ui.FeaturedWidget.Community.Name");
                communityDisplayProperty.Price      = OptionsResolver.IsActive(package, "Mslc.Ui.FeaturedWidget.Community.Price");
                communityDisplayProperty.PhotoCount = OptionsResolver.IsActive(package, "Mslc.Ui.FeaturedWidget.Community.PhotoCount");
                communityDisplayProperty.Image      = OptionsResolver.IsActive(package, "Mslc.Ui.FeaturedWidget.Community.Image");
                break;
            }

            case EntityLocation.CommunityDetails:
            {
                communityDisplayProperty.Address           = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.Address");
                communityDisplayProperty.WebsiteUrl        = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.WebsiteUrl");
                communityDisplayProperty.Name              = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.Name");
                communityDisplayProperty.Price             = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.Price");
                communityDisplayProperty.PhotoCount        = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.PhotoCount");
                communityDisplayProperty.Image             = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.Image");
                communityDisplayProperty.Bathes            = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.Bathes");
                communityDisplayProperty.Beds              = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.Beds");
                communityDisplayProperty.Area              = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.Area");
                communityDisplayProperty.Amenities         = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.Amenities");
                communityDisplayProperty.AdditionalImages  = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.AdditionalImages");
                communityDisplayProperty.Phone             = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.Phone");
                communityDisplayProperty.Description       = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.Description");
                communityDisplayProperty.CommunityServices = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.CommunityServices");
                communityDisplayProperty.Deposit           = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.Deposit");
                communityDisplayProperty.ApplicationFee    = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.ApplicationFee");
                communityDisplayProperty.PetDeposit        = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.PetDeposit");
                communityDisplayProperty.VirtualTourUrl    = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.VirtualTour");
                communityDisplayProperty.Logo              = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.Logo");
                communityDisplayProperty.Coupon            = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.Coupon");
                communityDisplayProperty.Pmc              = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.Pmc");
                communityDisplayProperty.ShcCategories    = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.ShcCategories");
                communityDisplayProperty.AgeRestrictions  = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.AgeRestrictions");
                communityDisplayProperty.PaymentsAccepted = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.PaymentsAccepted");
                communityDisplayProperty.OfficeHours      = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.OfficeHours");
                communityDisplayProperty.FloorPlans       = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.FloorPlans");
                communityDisplayProperty.SpecHomes        = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.SpecHomes");
                communityDisplayProperty.Homes            = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.Homes");
                communityDisplayProperty.LeadForm         = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.LeadForm");
                communityDisplayProperty.PhotoTour        = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Community.PhotoTour");
                break;
            }
            }
            return(communityDisplayProperty);
        }
コード例 #15
0
        public static SpecHomeDisplayProperties SpecHome(this SpecHomeDisplayProperties displayProperties, int package, EntityLocation location)
        {
            SpecHomeDisplayProperties specHomeDisplayProperty = displayProperties ?? new SpecHomeDisplayProperties();

            specHomeDisplayProperty = specHomeDisplayProperty.SpecHomeDefault(package);
            if (location == EntityLocation.QuickView)
            {
                specHomeDisplayProperty.Name      = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.SpecHome.Name");
                specHomeDisplayProperty.Image     = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.SpecHome.Image");
                specHomeDisplayProperty.Beds      = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.SpecHome.Beds");
                specHomeDisplayProperty.Bathes    = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.SpecHome.Bathes");
                specHomeDisplayProperty.Area      = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.SpecHome.Area");
                specHomeDisplayProperty.SaleType  = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.SpecHome.SaleType");
                specHomeDisplayProperty.Status    = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.SpecHome.Status");
                specHomeDisplayProperty.Price     = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.SpecHome.Price");
                specHomeDisplayProperty.LeadForm  = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.SpecHome.LeadForm");
                specHomeDisplayProperty.PhotoTour = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.Community.PhotoTour");
            }
            else if (location == EntityLocation.CommunityDetails)
            {
                specHomeDisplayProperty.Name           = OptionsResolver.IsActive(package, "Mslc.Ui.Details.SpecHome.Name");
                specHomeDisplayProperty.Image          = OptionsResolver.IsActive(package, "Mslc.Ui.Details.SpecHome.Image");
                specHomeDisplayProperty.Beds           = OptionsResolver.IsActive(package, "Mslc.Ui.Details.SpecHome.Beds");
                specHomeDisplayProperty.Bathes         = OptionsResolver.IsActive(package, "Mslc.Ui.Details.SpecHome.Bathes");
                specHomeDisplayProperty.Area           = OptionsResolver.IsActive(package, "Mslc.Ui.Details.SpecHome.Area");
                specHomeDisplayProperty.SaleType       = OptionsResolver.IsActive(package, "Mslc.Ui.Details.SpecHome.SaleType");
                specHomeDisplayProperty.Status         = OptionsResolver.IsActive(package, "Mslc.Ui.Details.SpecHome.Status");
                specHomeDisplayProperty.Price          = OptionsResolver.IsActive(package, "Mslc.Ui.Details.SpecHome.Price");
                specHomeDisplayProperty.Deposit        = OptionsResolver.IsActive(package, "Mslc.Ui.Details.SpecHome.Deposit");
                specHomeDisplayProperty.ApplicationFee = OptionsResolver.IsActive(package, "Mslc.Ui.Details.SpecHome.ApplicationFee");
                specHomeDisplayProperty.PetDeposit     = OptionsResolver.IsActive(package, "Mslc.Ui.Details.SpecHome.PetDeposit");
                specHomeDisplayProperty.Amenities      = OptionsResolver.IsActive(package, "Mslc.Ui.Details.SpecHome.Amenities");
                specHomeDisplayProperty.Description    = OptionsResolver.IsActive(package, "Mslc.Ui.Details.SpecHome.Description");
                specHomeDisplayProperty.LeadForm       = OptionsResolver.IsActive(package, "Mslc.Ui.Details.SpecHome.LeadForm");
                specHomeDisplayProperty.PhotoTour      = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.Community.PhotoTour");
            }
            return(specHomeDisplayProperty);
        }
コード例 #16
0
        public static ServiceProviderDisplayProperties ServiceProvider(this ServiceProviderDisplayProperties displayProperties, int package, EntityLocation location)
        {
            ServiceProviderDisplayProperties serviceProviderDisplayProperty = displayProperties;

            serviceProviderDisplayProperty = serviceProviderDisplayProperty.ServiceProviderDefault(package);
            switch (location)
            {
            case EntityLocation.Search:
            {
                serviceProviderDisplayProperty.Address           = OptionsResolver.IsActive(package, "Mslc.Ui.Search.ServiceProvider.Address");
                serviceProviderDisplayProperty.Featured          = OptionsResolver.IsActive(package, "Mslc.Ui.Search.ServiceProvider.Featured");
                serviceProviderDisplayProperty.Name              = OptionsResolver.IsActive(package, "Mslc.Ui.Search.ServiceProvider.Name");
                serviceProviderDisplayProperty.PhotoCount        = OptionsResolver.IsActive(package, "Mslc.Ui.Search.ServiceProvider.PhotoCount");
                serviceProviderDisplayProperty.Image             = OptionsResolver.IsActive(package, "Mslc.Ui.Search.ServiceProvider.Image");
                serviceProviderDisplayProperty.ServiceCategories = OptionsResolver.IsActive(package, "Mslc.Ui.Search.ServiceProvider.ServiceCategories");
                serviceProviderDisplayProperty.AdditionalImages  = OptionsResolver.IsActive(package, "Mslc.Ui.Search.ServiceProvider.AdditionalImages");
                serviceProviderDisplayProperty.Phone             = OptionsResolver.IsActive(package, "Mslc.Ui.Search.ServiceProvider.Phone");
                serviceProviderDisplayProperty.LeadForm          = OptionsResolver.IsActive(package, "Mslc.Ui.Search.ServiceProvider.LeadForm");
                serviceProviderDisplayProperty.QuickView         = OptionsResolver.IsActive(package, "Mslc.Ui.Search.ServiceProvider.QuickView");
                serviceProviderDisplayProperty.Map = OptionsResolver.IsActive(package, "Mslc.Ui.Search.ServiceProvider.Map");
                return(serviceProviderDisplayProperty);
            }

            case EntityLocation.QuickView:
            {
                serviceProviderDisplayProperty.Address           = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.ServiceProvider.Address");
                serviceProviderDisplayProperty.Name              = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.ServiceProvider.Name");
                serviceProviderDisplayProperty.PhotoCount        = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.ServiceProvider.PhotoCount");
                serviceProviderDisplayProperty.Image             = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.ServiceProvider.Image");
                serviceProviderDisplayProperty.ServiceCategories = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.ServiceProvider.ServiceCategories");
                serviceProviderDisplayProperty.AdditionalImages  = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.ServiceProvider.AdditionalImages");
                serviceProviderDisplayProperty.Phone             = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.ServiceProvider.Phone");
                serviceProviderDisplayProperty.Description       = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.ServiceProvider.Description");
                serviceProviderDisplayProperty.LeadForm          = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.ServiceProvider.LeadForm");
                serviceProviderDisplayProperty.PhotoTour         = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.ServiceProvider.PhotoTour");
                return(serviceProviderDisplayProperty);
            }

            case EntityLocation.FeaturedWidget:
            {
                serviceProviderDisplayProperty.Address    = OptionsResolver.IsActive(package, "Mslc.Ui.FeaturedWidget.ServiceProvider.Address");
                serviceProviderDisplayProperty.Name       = OptionsResolver.IsActive(package, "Mslc.Ui.FeaturedWidget.ServiceProvider.Name");
                serviceProviderDisplayProperty.PhotoCount = OptionsResolver.IsActive(package, "Mslc.Ui.FeaturedWidget.ServiceProvider.PhotoCount");
                serviceProviderDisplayProperty.Image      = OptionsResolver.IsActive(package, "Mslc.Ui.FeaturedWidget.ServiceProvider.Image");
                return(serviceProviderDisplayProperty);
            }

            case EntityLocation.CommunityDetails:
            {
                return(serviceProviderDisplayProperty);
            }

            case EntityLocation.ServiceProviderDetails:
            {
                serviceProviderDisplayProperty.Address           = OptionsResolver.IsActive(package, "Mslc.Ui.Details.ServiceProvider.Address");
                serviceProviderDisplayProperty.WebsiteUrl        = OptionsResolver.IsActive(package, "Mslc.Ui.Details.ServiceProvider.WebsiteUrl");
                serviceProviderDisplayProperty.Name              = OptionsResolver.IsActive(package, "Mslc.Ui.Details.ServiceProvider.Name");
                serviceProviderDisplayProperty.PhotoCount        = OptionsResolver.IsActive(package, "Mslc.Ui.Details.ServiceProvider.PhotoCount");
                serviceProviderDisplayProperty.Image             = OptionsResolver.IsActive(package, "Mslc.Ui.Details.ServiceProvider.Image");
                serviceProviderDisplayProperty.CountiesServed    = OptionsResolver.IsActive(package, "Mslc.Ui.Details.ServiceProvider.CountiesServed");
                serviceProviderDisplayProperty.ServiceCategories = OptionsResolver.IsActive(package, "Mslc.Ui.Details.ServiceProvider.ServiceCategories");
                serviceProviderDisplayProperty.AdditionalImages  = OptionsResolver.IsActive(package, "Mslc.Ui.Details.ServiceProvider.AdditionalImages");
                serviceProviderDisplayProperty.Phone             = OptionsResolver.IsActive(package, "Mslc.Ui.Details.ServiceProvider.Phone");
                serviceProviderDisplayProperty.Description       = OptionsResolver.IsActive(package, "Mslc.Ui.Details.ServiceProvider.Description");
                serviceProviderDisplayProperty.OfficeHours       = OptionsResolver.IsActive(package, "Mslc.Ui.Details.ServiceProvider.OfficeHours");
                serviceProviderDisplayProperty.PaymentsAccepted  = OptionsResolver.IsActive(package, "Mslc.Ui.Details.ServiceProvider.PaymentsAccepted");
                serviceProviderDisplayProperty.Coupon            = OptionsResolver.IsActive(package, "Mslc.Ui.Details.ServiceProvider.Coupon");
                serviceProviderDisplayProperty.LeadForm          = OptionsResolver.IsActive(package, "Mslc.Ui.Details.ServiceProvider.LeadForm");
                serviceProviderDisplayProperty.PhotoTour         = OptionsResolver.IsActive(package, "Mslc.Ui.Details.ServiceProvider.PhotoTour");
                serviceProviderDisplayProperty.Map = OptionsResolver.IsActive(package, "Mslc.Ui.Details.ServiceProvider.Map");
                return(serviceProviderDisplayProperty);
            }

            default:
            {
                return(serviceProviderDisplayProperty);
            }
            }
        }
コード例 #17
0
ファイル: World.cs プロジェクト: yvanoff/nitrosharp
 public BucketChangeResult(EntityLocation newLocation, EntityMove swap)
 => (NewLocation, Swap) = (newLocation, swap);
コード例 #18
0
ファイル: World.cs プロジェクト: yvanoff/nitrosharp
 public abstract BucketChangeResult ChangeBucket(
     EntityLocation entityLocation,
     EntityBucket dstBucket
     );
コード例 #19
0
 public void paste(IEntityContainer container, EntityLocation location)
 {
     this.container = container;
     this.location  = location;
     container.set(location, this);
 }
コード例 #20
0
 /// <summary>
 /// Gets the entity qualified name.
 /// </summary>
 /// <param name="entityLocation">
 /// The entity location.
 /// </param>
 /// <returns>
 /// The <see cref="string"/>.
 /// </returns>
 private string GetEntityCanonicalName(EntityLocation entityLocation)
 {
     return(string.IsNullOrWhiteSpace(entityLocation.Alias)
                ? $"{this.Escape(entityLocation.Container)}.{this.Escape(entityLocation.Name)}"
                : this.Escape(entityLocation.Alias));
 }
コード例 #21
0
ファイル: Assignment.cs プロジェクト: s151607/CoronAI
 public Assignment(Agent agent, EntityLocation entityLocation)
 {
     Agent          = agent;
     EntityLocation = entityLocation;
 }
コード例 #22
0
ファイル: World.cs プロジェクト: yvanoff/nitrosharp
 public EntityRec WithLocation(EntityLocation newLocation)
 => new(Entity, Group, newLocation);
コード例 #23
0
 protected ClassBuilderBase(Entity entity, EntityLocation location)
 {
     Entity           = entity;
     Location         = location;
     _propertyFactory = new PropertyClassFactory(location.ORMapper, location.GenerateRules);
 }
コード例 #24
0
ファイル: World.cs プロジェクト: yvanoff/nitrosharp
 public abstract EntityMove Remove(EntityLocation location);
コード例 #25
0
        private PlayerCharacterSerializer pcSerializer = null; // Used for storing pc data

        #endregion Fields

        #region Methods

        private void handleCreateChar(PlayerCharacter pc, IncommingMessage msg)
        {
            if (pc.LoginState == PlayerCharacterLoginState.ClientVersionCorrect)
            {
                CreateCharIncommingMessage msgCreateChar = (CreateCharIncommingMessage)msg;

                // Is acceptable character name
                if (!pcAuthentication.IsAcceptablePlayerName(msgCreateChar.UserName))
                {
                    CreateCharNotOkOutgoingMessage msgCreateCharNotOk =
                        (CreateCharNotOkOutgoingMessage)OutgoingMessagesFactory.Create(OutgoingMessageType.CREATE_CHAR_NOT_OK);
                    msgCreateCharNotOk.Message = "This character name is not acceptable.";
                    pc.PutMessageIntoMyQueue(msgCreateCharNotOk);
                    return;
                }

                // Does character exist?
                if (pcAuthentication.Exists(msgCreateChar.UserName))
                {
                    // Character already exists
                    CreateCharNotOkOutgoingMessage msgCreateCharNotOk =
                        (CreateCharNotOkOutgoingMessage)OutgoingMessagesFactory.Create(OutgoingMessageType.CREATE_CHAR_NOT_OK);
                    msgCreateCharNotOk.Message = "A character with that name already exists.";
                    pc.PutMessageIntoMyQueue(msgCreateCharNotOk);
                    return;
                }

                // TODO: Add check for appearace values

                // All ok. Create a character
                try
                {
                    pcAuthentication.Create(msgCreateChar.UserName, msgCreateChar.Password);
                }
                catch (Exception ex)
                {
                    logger.LogError(LogSource.World, "Failed to create player " + pc.Name, ex);
                    CreateCharNotOkOutgoingMessage msgCreateCharNotOk =
                        (CreateCharNotOkOutgoingMessage)OutgoingMessagesFactory.Create(OutgoingMessageType.CREATE_CHAR_NOT_OK);
                    msgCreateCharNotOk.Message = "Server could not create the character.";
                    pc.PutMessageIntoMyQueue(msgCreateCharNotOk);
                    return;
                }

                // Clear character (current state of character is undefined!)
                pc.ClearEntityImplementation();

                EntityAppearance appearance = new EntityAppearance(msgCreateChar.Type);

                appearance.Head = msgCreateChar.Head;
                appearance.Skin = msgCreateChar.Skin;
                appearance.Hair = msgCreateChar.Hair;
                appearance.Shirt = msgCreateChar.Shirt;
                appearance.Pants = msgCreateChar.Pants;
                appearance.Boots = msgCreateChar.Boots;
                pc.Name = msgCreateChar.UserName;
                pc.CreateSetInitialAppearance(appearance);

                EntityLocation location = new EntityLocation();
                short deviation = mapManager.StartPointDeviation;
                location.X = (short)(mapManager.StartPointX + (sbyte)WorldRNG.Next(-deviation, deviation));
                location.Y = (short)(mapManager.StartPointY + (sbyte)WorldRNG.Next(-deviation, deviation));
                location.Z = 0;
                location.Rotation = 0;
                location.CurrentMap = mapManager.StartPointMap;
                pc.CreateSetInitialLocation(location);

                // TODO: Apply race specific factors

                // Add bonus items
                ItemDefinition itmDef = null;

                // Royals
                itmDef = ItemDefinitionCache.GetItemDefinitionByID(5);
                if (itmDef != null)
                {
                    Item itm = new Item(itmDef);
                    itm.Quantity = 100;
                    pc.InventoryUpdateItem(itm);
                }

                // Recalculate enerigies
                pc.CreateRecalculateInitialEnergies();

                // Store data
                try
                {
                    pc.ForceSerialization();
                    pc.Serialize(pcSerializer);
                }
                catch (Exception ex)
                {
                    logger.LogError(LogSource.World, "Failed to serialize player " + pc.Name, ex);
                    CreateCharNotOkOutgoingMessage msgCreateCharNotOk =
                        (CreateCharNotOkOutgoingMessage)OutgoingMessagesFactory.Create(OutgoingMessageType.CREATE_CHAR_NOT_OK);
                    msgCreateCharNotOk.Message = "Server could not create the character.";
                    pc.PutMessageIntoMyQueue(msgCreateCharNotOk);
                    return;
                }

                // Send char created ok message
                pc.PutMessageIntoMyQueue(msgStdCreateCharOk);
            }
        }
コード例 #26
0
ファイル: World.cs プロジェクト: yvanoff/nitrosharp
            public EntityRec WithBucket(EntityBucket newBucket)
            {
                var location = new EntityLocation(newBucket, Location.Index);

                return(new EntityRec(Entity, Group, location));
            }
コード例 #27
0
 public void paste(EntityLocation location)
 {
     this.location = location;
     container.set(location, this);
 }
コード例 #28
0
 private EntityLocation DefaultValues(EntityLocation row)
 {
     return row;
 }
コード例 #29
0
ファイル: DefaultClassBuilder.cs プロジェクト: bordev/Tobasco
 public DefaultClassBuilder(Entity entity, EntityLocation location) : base(entity, location)
 {
 }
コード例 #30
0
ファイル: World.cs プロジェクト: yvanoff/nitrosharp
 public EntityMove(Entity?entity, EntityLocation newLocation)
 => (Entity, NewLocation) = (entity, newLocation);
コード例 #31
0
ファイル: WorldSimulation.cs プロジェクト: ago1024/Calindor
        private void addServerCharacters()
        {
            // TODO: Implement based on scripts!!!

            // create npc owyn
            ServerCharacter npcOwyn = new ServerCharacter(PredefinedEntityImplementationKind.ENTITY_NPC);
            EntityAppearance appearance = new EntityAppearance(PredefinedModelType.HUMAN_MALE);
            appearance.Boots = PredefinedModelBoots.BOOTS_BROWN;
            appearance.Hair = PredefinedModelHair.HAIR_BROWN;
            appearance.Head = PredefinedModelHead.HEAD_1;
            appearance.Pants = PredefinedModelPants.PANTS_BLUE;
            appearance.Shirt = PredefinedModelShirt.SHIRT_LIGHTBROWN;
            appearance.Skin = PredefinedModelSkin.SKIN_PALE;
            npcOwyn.Name = "Owyn";
            npcOwyn.CreateSetInitialAppearance(appearance);
            EntityLocation location = new EntityLocation();
            location.CurrentMap = mapManager.StartPointMap;
            location.Z = 0;
            location.X = 122;
            location.Y = 125;
            location.Rotation = 270;
            location.IsSittingDown = false;
            npcOwyn.CreateSetInitialLocation(location);

            // add npc to the world
            addEntityImplementationToWorld(npcOwyn);
            npcOwyn.LocationChangeMapAtEnterWorld();
            npcOwyn.CreateApplyInitialState();

            // create npc cerdiss
            ServerCharacter npcCerdiss = new ServerCharacter(PredefinedEntityImplementationKind.ENTITY_NPC);
            EntityAppearance appearanceCerdiss = new EntityAppearance(PredefinedModelType.SKELETON);
            npcCerdiss.Name = "Cerdiss";
            npcCerdiss.CreateSetInitialAppearance(appearanceCerdiss);
            EntityLocation locationCerdiss = new EntityLocation();
            locationCerdiss.CurrentMap = mapManager.StartPointMap;
            locationCerdiss.Z = 0;
            locationCerdiss.X = 163;
            locationCerdiss.Y = 29;
            locationCerdiss.Rotation = 180;
            locationCerdiss.IsSittingDown = false;
            locationCerdiss.Dimension = (int)PredefinedDimension.SHADOWS;
            npcCerdiss.CreateSetInitialLocation(locationCerdiss);
            npcCerdiss.CreateApplyInitialState();

            // add npc to the world
            addEntityImplementationToWorld(npcCerdiss);
            npcCerdiss.LocationChangeMapAtEnterWorld();

            for (int i = 0; i < 3; i++)
            {
                // create rat
                ServerCharacter rat1 = new ServerCharacter(PredefinedEntityImplementationKind.ENTITY);
                EntityAppearance appearancerat = new EntityAppearance(PredefinedModelType.RAT);
                rat1.CreateSetInitialAppearance(appearancerat);
                rat1.Name = "Rat";
                EntityLocation locationrat = new EntityLocation();
                locationrat.CurrentMap = mapManager.StartPointMap;
                locationrat.Z = 0;
                locationrat.X = (short)(107 + i);
                locationrat.Y = (short)(167 + i);
                locationrat.Rotation = 180;
                locationrat.IsSittingDown = false;
                rat1.CreateSetInitialLocation(locationrat);
                rat1.CreateSetRespawnTime(30000);
                rat1.MaxCombatXP = 2000; // easy
                rat1.CreateApplyInitialState();

                // AI
                WonderingDumbNonAggresiveAIImplementation aiImpl =
                    new WonderingDumbNonAggresiveAIImplementation(locationrat.X, locationrat.Y, 15, 2000);
                rat1.AIAttach(aiImpl);

                // add rat to the world
                addEntityImplementationToWorld(rat1);
                rat1.LocationChangeMapAtEnterWorld();
            }

            for (int i = 0; i < 1; i++)
            {
                // create rat
                ServerCharacter rat1 = new ServerCharacter(PredefinedEntityImplementationKind.ENTITY);
                EntityAppearance appearancerat = new EntityAppearance(PredefinedModelType.RAT);
                rat1.CreateSetInitialAppearance(appearancerat);
                rat1.Name = "Rat";
                EntityLocation locationrat = new EntityLocation();
                locationrat.CurrentMap = mapManager.StartPointMap;
                locationrat.Z = 0;
                locationrat.X = (short)(91 + i);
                locationrat.Y = (short)(117 + i);
                locationrat.Rotation = 180;
                locationrat.IsSittingDown = false;
                rat1.CreateSetInitialLocation(locationrat);
                rat1.CreateSetRespawnTime(30000);
                rat1.MaxCombatXP = 4000; // medium
                rat1.CreateApplyInitialState();

                // AI
                WonderingDumbNonAggresiveAIImplementation aiImpl =
                    new WonderingDumbNonAggresiveAIImplementation(locationrat.X, locationrat.Y, 10, 2000);
                rat1.AIAttach(aiImpl);

                // add rat to the world
                addEntityImplementationToWorld(rat1);
                rat1.LocationChangeMapAtEnterWorld();
            }

            for (int i = 0; i < 2; i++)
            {
                // create rabbit
                ServerCharacter rabbit1 = new ServerCharacter(PredefinedEntityImplementationKind.ENTITY);
                EntityAppearance appearanceRabbit = new EntityAppearance(PredefinedModelType.BROWN_RABBIT);
                rabbit1.CreateSetInitialAppearance(appearanceRabbit);
                rabbit1.Name = "Rabbit";
                EntityLocation locationRabbit = new EntityLocation();
                locationRabbit.CurrentMap = mapManager.StartPointMap;
                locationRabbit.Z = 0;
                locationRabbit.X = (short)(54 + i);
                locationRabbit.Y = (short)(138 + i);
                locationRabbit.Rotation = 180;
                locationRabbit.IsSittingDown = false;
                rabbit1.CreateSetInitialLocation(locationRabbit);
                rabbit1.CreateSetRespawnTime(40000);
                rabbit1.MaxCombatXP = 4000; // medium
                rabbit1.CreateApplyInitialState();

                // AI
                WonderingDumbNonAggresiveAIImplementation aiImpl =
                    new WonderingDumbNonAggresiveAIImplementation(locationRabbit.X, locationRabbit.Y, 30,3000);
                rabbit1.AIAttach(aiImpl);

                // add rabbit to the world
                addEntityImplementationToWorld(rabbit1);
                rabbit1.LocationChangeMapAtEnterWorld();
            }

            for (int i = 0; i < 2; i++)
            {
                // create rabbit
                ServerCharacter rabbit1 = new ServerCharacter(PredefinedEntityImplementationKind.ENTITY);
                EntityAppearance appearanceRabbit = new EntityAppearance(PredefinedModelType.BROWN_RABBIT);
                rabbit1.CreateSetInitialAppearance(appearanceRabbit);
                rabbit1.Name = "Rabbit";
                EntityLocation locationRabbit = new EntityLocation();
                locationRabbit.CurrentMap = mapManager.StartPointMap;
                locationRabbit.Z = 0;
                locationRabbit.X = (short)(27 + i);
                locationRabbit.Y = (short)(41 + i);
                locationRabbit.Rotation = 180;
                locationRabbit.IsSittingDown = false;
                rabbit1.CreateSetInitialLocation(locationRabbit);
                rabbit1.CreateSetRespawnTime(40000);
                rabbit1.MaxCombatXP = 4000; // medium
                rabbit1.CreateApplyInitialState();

                // AI
                WonderingDumbNonAggresiveAIImplementation aiImpl =
                    new WonderingDumbNonAggresiveAIImplementation(locationRabbit.X, locationRabbit.Y, 30, 3000);
                rabbit1.AIAttach(aiImpl);

                // add rabbit to the world
                addEntityImplementationToWorld(rabbit1);
                rabbit1.LocationChangeMapAtEnterWorld();
            }

            for (int i = 0; i < 2; i++)
            {
                // create snake
                ServerCharacter snake1 = new ServerCharacter(PredefinedEntityImplementationKind.ENTITY);
                EntityAppearance appearancesnake = new EntityAppearance(PredefinedModelType.SNAKE_1);
                snake1.CreateSetInitialAppearance(appearancesnake);
                snake1.Name = "Snake";
                EntityLocation locationsnake = new EntityLocation();
                locationsnake.CurrentMap = mapManager.StartPointMap;
                locationsnake.Z = 0;
                locationsnake.X = (short)(149 + i);
                locationsnake.Y = (short)(131 + i);
                locationsnake.Rotation = 180;
                locationsnake.IsSittingDown = false;
                snake1.CreateSetInitialLocation(locationsnake);
                snake1.CreateSetRespawnTime(30000);
                snake1.MaxCombatXP = 6000; // hard
                snake1.CreateApplyInitialState();

                // AI
                WonderingDumbNonAggresiveAIImplementation aiImpl =
                    new WonderingDumbNonAggresiveAIImplementation(locationsnake.X, locationsnake.Y, 20, 3000);
                snake1.AIAttach(aiImpl);

                // add snake to the world
                addEntityImplementationToWorld(snake1);
                snake1.LocationChangeMapAtEnterWorld();
            }

            // create troll
            ServerCharacter troll1 = new ServerCharacter(PredefinedEntityImplementationKind.ENTITY);
            EntityAppearance appearancetroll = new EntityAppearance(PredefinedModelType.TROLL);
            troll1.CreateSetInitialAppearance(appearancetroll);
            troll1.Name = "Troll";
            EntityLocation locationtroll = new EntityLocation();
            locationtroll.CurrentMap = mapManager.StartPointMap;
            locationtroll.Z = 0;
            locationtroll.X = 74;
            locationtroll.Y = 63;
            locationtroll.Rotation = 90;
            locationtroll.IsSittingDown = false;
            troll1.CreateSetInitialLocation(locationtroll);
            troll1.CreateSetRespawnTime(60000);
            troll1.MaxCombatXP = 20000; // Impossible
            troll1.CreateApplyInitialState();

            // add troll to the world
            addEntityImplementationToWorld(troll1);
            troll1.LocationChangeMapAtEnterWorld();

            // create deer
            ServerCharacter deer1 = new ServerCharacter(PredefinedEntityImplementationKind.ENTITY);
            EntityAppearance appearancedeer = new EntityAppearance(PredefinedModelType.DEER);
            deer1.CreateSetInitialAppearance(appearancedeer);
            deer1.Name = "Deer";
            EntityLocation locationdeer = new EntityLocation();
            locationdeer.CurrentMap = mapManager.StartPointMap;
            locationdeer.Z = 0;
            locationdeer.X = 104;
            locationdeer.Y = 19;
            locationdeer.Rotation = 0;
            locationdeer.IsSittingDown = false;
            deer1.CreateSetInitialLocation(locationdeer);
            deer1.CreateSetRespawnTime(60000);
            deer1.MaxCombatXP = 6000; // hard
            deer1.CreateApplyInitialState();

            // AI
            WonderingDumbNonAggresiveAIImplementation aiImplDeer =
                new WonderingDumbNonAggresiveAIImplementation(locationdeer.X, locationdeer.Y, 50, 5000);
            deer1.AIAttach(aiImplDeer);

            // add deer to the world
            addEntityImplementationToWorld(deer1);
            deer1.LocationChangeMapAtEnterWorld();

            // create beaver
            ServerCharacter beaver1 = new ServerCharacter(PredefinedEntityImplementationKind.ENTITY);
            EntityAppearance appearancebeaver = new EntityAppearance(PredefinedModelType.DEER);
            beaver1.CreateSetInitialAppearance(appearancebeaver);
            beaver1.Name = "Deer";
            EntityLocation locationbeaver = new EntityLocation();
            locationbeaver.CurrentMap = mapManager.StartPointMap;
            locationbeaver.Z = 0;
            locationbeaver.X = 164;
            locationbeaver.Y = 42;
            locationbeaver.Rotation = 0;
            locationbeaver.IsSittingDown = false;
            beaver1.CreateSetInitialLocation(locationbeaver);
            beaver1.CreateSetRespawnTime(60000);
            beaver1.MaxCombatXP = 4000; // medium
            beaver1.CreateApplyInitialState();

            // AI
            WonderingDumbNonAggresiveAIImplementation aiImplbeaver =
                new WonderingDumbNonAggresiveAIImplementation(locationbeaver.X, locationbeaver.Y, 50, 5000);
            beaver1.AIAttach(aiImplbeaver);

            // add beaver to the world
            addEntityImplementationToWorld(beaver1);
            beaver1.LocationChangeMapAtEnterWorld();

            // create armedSkell
            ServerCharacter armedSkell1 = new ServerCharacter(PredefinedEntityImplementationKind.ENTITY);
            EntityAppearance appearancearmedSkell = new EntityAppearance(PredefinedModelType.ARMED_SKELETON);
            armedSkell1.CreateSetInitialAppearance(appearancearmedSkell);
            armedSkell1.Name = "Armed Skeleton";
            EntityLocation locationarmedSkell = new EntityLocation();
            locationarmedSkell.CurrentMap = mapManager.StartPointMap;
            locationarmedSkell.Z = 0;
            locationarmedSkell.X = 158;
            locationarmedSkell.Y = 26;
            locationarmedSkell.Rotation = 0;
            locationarmedSkell.IsSittingDown = false;
            locationarmedSkell.Dimension = (int)PredefinedDimension.SHADOWS;
            armedSkell1.CreateSetInitialLocation(locationarmedSkell);
            armedSkell1.CreateSetRespawnTime(60000);
            armedSkell1.MaxCombatXP = 6000; // hard
            armedSkell1.CreateApplyInitialState();

            // AI
            WonderingDumbNonAggresiveAIImplementation aiImplarmedSkell =
                new WonderingDumbNonAggresiveAIImplementation(locationarmedSkell.X, locationarmedSkell.Y, 10, 5000);
            armedSkell1.AIAttach(aiImplarmedSkell);

            // add armedSkell to the world
            addEntityImplementationToWorld(armedSkell1);
            armedSkell1.LocationChangeMapAtEnterWorld();

            // create town person
            ServerCharacter townperson = new ServerCharacter(PredefinedEntityImplementationKind.ENTITY);
            EntityAppearance appearance2 = new EntityAppearance(PredefinedModelType.DWARF_MALE);
            appearance2.Boots = PredefinedModelBoots.BOOTS_BROWN;
            appearance2.Hair = PredefinedModelHair.HAIR_BLOND;
            appearance2.Head = PredefinedModelHead.HEAD_3;
            appearance2.Pants = PredefinedModelPants.PANTS_GREEN;
            appearance2.Shirt = PredefinedModelShirt.SHIRT_BLUE;
            appearance2.Skin = PredefinedModelSkin.SKIN_PALE;
            townperson.Name = "Boric";
            townperson.CreateSetInitialAppearance(appearance2);
            EntityLocation location2 = new EntityLocation();
            location2.CurrentMap = mapManager.StartPointMap;
            location2.Z = 0;
            location2.X = 100;
            location2.Y = 143;
            location2.Rotation = 180;
            location2.IsSittingDown = false;
            townperson.CreateSetInitialLocation(location2);
            townperson.CreateSetRespawnTime(0);
            townperson.MaxCombatXP = 6000; // hard
            townperson.CreateApplyInitialState();

            // AI
            WonderingDumbNonAggresiveAIImplementation aiImpltownperson =
                new WonderingDumbNonAggresiveAIImplementation(location2.X, location2.Y, 60, 10000);
            townperson.AIAttach(aiImpltownperson);

            // add npc to the world
            addEntityImplementationToWorld(townperson);
            townperson.LocationChangeMapAtEnterWorld();
        }
コード例 #32
0
        public static FloorPlanDisplayProperties FloorPlan(this FloorPlanDisplayProperties displayProperties, int package, EntityLocation location)
        {
            FloorPlanDisplayProperties floorPlanDisplayProperty = displayProperties ?? new FloorPlanDisplayProperties();

            floorPlanDisplayProperty = floorPlanDisplayProperty.FloorPlanDefault(package);
            if (location == EntityLocation.QuickView)
            {
                floorPlanDisplayProperty.Name      = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.FloorPlan.Name");
                floorPlanDisplayProperty.Image     = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.FloorPlan.Image");
                floorPlanDisplayProperty.Beds      = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.FloorPlan.Beds");
                floorPlanDisplayProperty.Bathes    = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.FloorPlan.Bathes");
                floorPlanDisplayProperty.Area      = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.FloorPlan.Area");
                floorPlanDisplayProperty.Price     = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.FloorPlan.Price");
                floorPlanDisplayProperty.LeadForm  = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.FloorPlan.LeadForm");
                floorPlanDisplayProperty.PhotoTour = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.Community.PhotoTour");
            }
            else if (location == EntityLocation.CommunityDetails)
            {
                floorPlanDisplayProperty.Name           = OptionsResolver.IsActive(package, "Mslc.Ui.Details.FloorPlan.Name");
                floorPlanDisplayProperty.Image          = OptionsResolver.IsActive(package, "Mslc.Ui.Details.FloorPlan.Image");
                floorPlanDisplayProperty.Beds           = OptionsResolver.IsActive(package, "Mslc.Ui.Details.FloorPlan.Beds");
                floorPlanDisplayProperty.Bathes         = OptionsResolver.IsActive(package, "Mslc.Ui.Details.FloorPlan.Bathes");
                floorPlanDisplayProperty.Area           = OptionsResolver.IsActive(package, "Mslc.Ui.Details.FloorPlan.Area");
                floorPlanDisplayProperty.Price          = OptionsResolver.IsActive(package, "Mslc.Ui.Details.FloorPlan.Price");
                floorPlanDisplayProperty.Deposit        = OptionsResolver.IsActive(package, "Mslc.Ui.Details.FloorPlan.Deposit");
                floorPlanDisplayProperty.ApplicationFee = OptionsResolver.IsActive(package, "Mslc.Ui.Details.FloorPlan.ApplicationFee");
                floorPlanDisplayProperty.PetDeposit     = OptionsResolver.IsActive(package, "Mslc.Ui.Details.FloorPlan.PetDeposit");
                floorPlanDisplayProperty.Amenities      = OptionsResolver.IsActive(package, "Mslc.Ui.Details.FloorPlan.Amenities");
                floorPlanDisplayProperty.LeadForm       = OptionsResolver.IsActive(package, "Mslc.Ui.Details.FloorPlan.LeadForm");
                floorPlanDisplayProperty.PhotoTour      = OptionsResolver.IsActive(package, "Mslc.Ui.Search.QuickView.Community.PhotoTour");
            }
            return(floorPlanDisplayProperty);
        }
コード例 #33
0
 public virtual void CreateSetInitialLocation(EntityLocation location)
 {
     if (!isEntityImplementationInCreationPhase())
         throw new InvalidOperationException("This method can only be used during creation!");
     this.location = location;
 }
コード例 #34
0
        public static OwnerDisplayProperties Owner(this OwnerDisplayProperties displayProperties, int package, EntityLocation location)
        {
            OwnerDisplayProperties ownerDisplayProperty = displayProperties ?? new OwnerDisplayProperties();

            ownerDisplayProperty = ownerDisplayProperty.OwnerDefault(package);
            if (location == EntityLocation.CommunityDetails)
            {
                ownerDisplayProperty.Name       = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Owner.Name");
                ownerDisplayProperty.Phone      = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Owner.Phone");
                ownerDisplayProperty.WebsiteUrl = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Owner.WebsiteUrl");
                ownerDisplayProperty.Logo       = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Owner.Logo");
                ownerDisplayProperty.Address    = OptionsResolver.IsActive(package, "Mslc.Ui.Details.Owner.Address");
            }
            return(ownerDisplayProperty);
        }