當前位置: 首頁>>代碼示例>>C#>>正文


C# IEntityFactory類代碼示例

本文整理匯總了C#中IEntityFactory的典型用法代碼示例。如果您正苦於以下問題:C# IEntityFactory類的具體用法?C# IEntityFactory怎麽用?C# IEntityFactory使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IEntityFactory類屬於命名空間,在下文中一共展示了IEntityFactory類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: RegisterEntityFactory

	/// <summary>
	/// Registers the entity factory.
	/// </summary>
	/// <returns><c>true</c>, if entity factory was registered, <c>false</c> otherwise.</returns>
	/// <param name="szTypeName">Size type name.</param>
	/// <param name="factory">Factory.</param>
	public virtual void		RegisterEntityFactory(string szFactoryName, IEntityFactory factory)
	{
		if (!m_dFactory.ContainsKey(szFactoryName))
		{
			m_dFactory.Add(szFactoryName, factory);
		}
	}
開發者ID:oathx,項目名稱:Six,代碼行數:13,代碼來源:IEntityManager.cs

示例2: GetFactory

        public static IEntityFactory GetFactory()
        {
            if (_FACTORY == null)
                _FACTORY = new EntityFactory();

            return _FACTORY;
        }
開發者ID:thebuchanan3,項目名稱:ContinentsCs,代碼行數:7,代碼來源:EntityFactory.cs

示例3: Player

        public Player(IMovement movement, IEntityFactory networkPlayer, ICurrentNode currentNode, string name)
        {
            currentNode.SetName(name);
            networkPlayer.CreateNetworkingPlayer();

            _name = name;
        }
開發者ID:hach-que,項目名稱:Protoinject,代碼行數:7,代碼來源:Player.cs

示例4: SeatingPrioritySetupModel

 public SeatingPrioritySetupModel(IAreaRepository areaRepository,
     IEmployeeRepository employeeRepository, IEntityFactory entityFactory)
 {
     _areaRepository = areaRepository;
     _entityFactory = entityFactory;
     _employeeRepository = employeeRepository;
 }
開發者ID:Mrding,項目名稱:Ribbon,代碼行數:7,代碼來源:SeatingPrioritySetupModel.cs

示例5: MyGameWorld

        public MyGameWorld(
            I2DRenderUtilities renderUtilities,
            IAssetManagerProvider assetManagerProvider,
            IEntityFactory entityFactory)
        {
            this.Entities = new List<IEntity>();

            _renderUtilities = renderUtilities;
            _assetManager = assetManagerProvider.GetAssetManager();
            _defaultFont = this._assetManager.Get<FontAsset>("font.Default");

            // You can also save the entity factory in a field and use it, e.g. in the Update
            // loop or anywhere else in your game.
            var entityA = entityFactory.CreateExampleEntity("EntityA");
            entityA.X = 100;
            entityA.Y = 50;
            var entityB = entityFactory.CreateExampleEntity("EntityB");
            entityB.X = 120;
            entityB.Y = 100;

            // Don't forget to add your entities to the world!
            this.Entities.Add(entityA);
            this.Entities.Add(entityB);

            // This pulls in the texture asset via the asset manager.  Note that
            // the folder seperator from "texture/Player" has been translated
            // into a single dot.
            _playerTexture = _assetManager.Get<TextureAsset>("texture.Player");
        }
開發者ID:hach-que,項目名稱:Protogame.Docs,代碼行數:29,代碼來源:referencing_an_asset_full_code.cs

示例6: Initialize

        public void Initialize(EntityWorld entityWorld, IEntityFactory entityFactory)
        {
            _entityWorld = entityWorld;
            EntityFactory = entityFactory;

            _entityWorld.EntityManager.AddedEntityEvent += OnEntityAdded;
            _entityWorld.EntityManager.RemovedEntityEvent += OnEntityRemoved;
        }
開發者ID:jtuttle,項目名稱:umbra-client,代碼行數:8,代碼來源:CrawEntityManager.cs

示例7: AttendanceManagerModel

 public AttendanceManagerModel(IEntityFactory entityFactory, IEmployeeRepository employeeRepository, IRepository<Schedule> scheduleRepository, 
     IAttendanceRepository attendanceRepository)
 {
     _entityFactory = entityFactory;
     _employeeRepository = employeeRepository;
     _scheduleRepository = scheduleRepository;
     _attendanceRepository = attendanceRepository;
 }
開發者ID:Mrding,項目名稱:Ribbon,代碼行數:8,代碼來源:AttendanceManagerModel.cs

示例8: StaffingChartPresenter

 public StaffingChartPresenter(IStaffingCalculatorModel staffingCalculatorModel,
     IEntityFactory entityFactory, Schedule schedule, IStaffingCalculatorService service)
 {
     _schedule = schedule;
     _staffingService = service;
     _staffingCalculatorModel = staffingCalculatorModel;
     _entityFactory = entityFactory;
 }
開發者ID:Mrding,項目名稱:Ribbon,代碼行數:8,代碼來源:StaffingChartPresenter.cs

示例9: EntityController

        internal EntityController(IEntityRepository repository, IEntityFactory factory)
        {
            _entityRepository = repository;
            _entityFactory = factory;

            // TODO: somehow make this automatic (base constructor of controllers didn't work out)
            Initialize();
        }
開發者ID:bjadamson,項目名稱:Smashteroids,代碼行數:8,代碼來源:EntityController.cs

示例10: GetMultiUsingRolesWithAuditAction

 /// <summary>Retrieves in the calling AuditActionCollection object all AuditActionEntity objects which are related via a relation of type 'm:n' with the passed in RoleEntity.</summary>
 /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param>
 /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param>
 /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. When set to 0, no limitations are specified.</param>
 /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param>
 /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
 /// <param name="roleInstance">RoleEntity object to be used as a filter in the m:n relation</param>
 /// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch.</param>
 /// <param name="pageNumber">The page number to retrieve.</param>
 /// <param name="pageSize">The page size of the page to retrieve.</param>
 /// <returns>true if succeeded, false otherwise</returns>
 public bool GetMultiUsingRolesWithAuditAction(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity roleInstance, IPrefetchPath prefetchPathToUse, int pageNumber, int pageSize)
 {
     RelationCollection relations = new RelationCollection();
     relations.Add(AuditActionEntity.Relations.RoleAuditActionEntityUsingAuditActionID, "RoleAuditAction_");
     relations.Add(RoleAuditActionEntity.Relations.RoleEntityUsingRoleID, "RoleAuditAction_", string.Empty, JoinHint.None);
     IPredicateExpression selectFilter = new PredicateExpression();
     selectFilter.Add(new FieldCompareValuePredicate(roleInstance.Fields[(int)RoleFieldIndex.RoleID], ComparisonOperator.Equal));
     return this.GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, prefetchPathToUse, pageNumber, pageSize);
 }
開發者ID:priaonehaha,項目名稱:HnD,代碼行數:20,代碼來源:AuditActionDAO.cs

示例11: GetMulti

 /// <summary>Retrieves in the calling MembershipCollection object all MembershipEntity objects which have data in common with the specified related Entities. If one is omitted, that entity is not used as a filter. </summary>
 /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param>
 /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param>
 /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. When set to 0, no limitations are specified.</param>
 /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param>
 /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
 /// <param name="filter">Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored.</param>
 /// <param name="roleInstance">RoleEntity instance to use as a filter for the MembershipEntity objects to return</param>
 /// <param name="storeInformationInstance">StoreInformationEntity instance to use as a filter for the MembershipEntity objects to return</param>
 /// <param name="pageNumber">The page number to retrieve.</param>
 /// <param name="pageSize">The page size of the page to retrieve.</param>
 public bool GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicateExpression filter, IEntity roleInstance, IEntity storeInformationInstance, int pageNumber, int pageSize)
 {
     this.EntityFactoryToUse = entityFactoryToUse;
     IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(ProductSearchEngine.EntityType.MembershipEntity);
     IPredicateExpression selectFilter = CreateFilterUsingForeignKeys(roleInstance, storeInformationInstance, fieldsToReturn);
     if(filter!=null)
     {
         selectFilter.AddWithAnd(filter);
     }
     return this.PerformGetMultiAction(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, selectFilter, null, null, null, pageNumber, pageSize);
 }
開發者ID:fahrigoktuna,項目名稱:ProductSearchEngine,代碼行數:22,代碼來源:MembershipDAO.cs

示例12: DefaultWorld

        public DefaultWorld(
            IProfiler profiler,
            INetworkingSession networkSession,
            IEntityFactory playerFactory,
            ICurrentNode currentNode)
        {
            currentNode.SetName("AmazingWorld");

            playerFactory.CreatePlayer("Player1");
            playerFactory.CreatePlayer("Player2");
        }
開發者ID:hach-que,項目名稱:Protoinject,代碼行數:11,代碼來源:DefaultWorld.cs

示例13: GetMulti

 /// <summary>Retrieves in the calling ForumCollection object all ForumEntity objects which have data in common with the specified related Entities. If one is omitted, that entity is not used as a filter. </summary>
 /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param>
 /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param>
 /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. When set to 0, no limitations are specified.</param>
 /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param>
 /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
 /// <param name="filter">Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored.</param>
 /// <param name="sectionInstance">SectionEntity instance to use as a filter for the ForumEntity objects to return</param>
 /// <param name="defaultSupportQueueInstance">SupportQueueEntity instance to use as a filter for the ForumEntity objects to return</param>
 /// <param name="pageNumber">The page number to retrieve.</param>
 /// <param name="pageSize">The page size of the page to retrieve.</param>
 public bool GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicateExpression filter, IEntity sectionInstance, IEntity defaultSupportQueueInstance, int pageNumber, int pageSize)
 {
     this.EntityFactoryToUse = entityFactoryToUse;
     IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(SD.HnD.DAL.EntityType.ForumEntity);
     IPredicateExpression selectFilter = CreateFilterUsingForeignKeys(sectionInstance, defaultSupportQueueInstance, fieldsToReturn);
     if(filter!=null)
     {
         selectFilter.AddWithAnd(filter);
     }
     return this.PerformGetMultiAction(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, selectFilter, null, null, null, pageNumber, pageSize);
 }
開發者ID:priaonehaha,項目名稱:HnD,代碼行數:22,代碼來源:ForumDAO.cs

示例14: ScheduleManagerModel

 public ScheduleManagerModel(ICampaignScheduleRepository repository, ICampaignRepository campaignRepository,
                             IServiceQueueRepository serviceQueueRepository, IAttendanceRepository attendanceRepository,
     IOrganizationRepository organizationRepository,
                             IEntityFactory entityFactory)
 {
     _repository = repository;
     _campaignRepository = campaignRepository;
     _serviceQueueRepository = serviceQueueRepository;
     _entityFactory = entityFactory;
     _attendanceRepository = attendanceRepository;
     _organizationRepository = organizationRepository;
 }
開發者ID:Mrding,項目名稱:Ribbon,代碼行數:12,代碼來源:ScheduleManagerModel.cs

示例15: Game1

        public Game1()
        {
            _graphics = new GraphicsDeviceManager(this);
            _collisionManager = new CollisionManager();
            _entityFactory = new EntityFactory(this);
            Content.RootDirectory = "Content";

            Services.AddService(typeof(IEntityFactory), _entityFactory);
            Services.AddService(typeof(CollisionManager), _collisionManager);
            Services.AddService(typeof(ContentManager), Content);

        }
開發者ID:swallentin,項目名稱:XNA.Pong,代碼行數:12,代碼來源:Game1.cs


注:本文中的IEntityFactory類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。