本文整理汇总了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);
}
}
示例2: GetFactory
public static IEntityFactory GetFactory()
{
if (_FACTORY == null)
_FACTORY = new EntityFactory();
return _FACTORY;
}
示例3: Player
public Player(IMovement movement, IEntityFactory networkPlayer, ICurrentNode currentNode, string name)
{
currentNode.SetName(name);
networkPlayer.CreateNetworkingPlayer();
_name = name;
}
示例4: SeatingPrioritySetupModel
public SeatingPrioritySetupModel(IAreaRepository areaRepository,
IEmployeeRepository employeeRepository, IEntityFactory entityFactory)
{
_areaRepository = areaRepository;
_entityFactory = entityFactory;
_employeeRepository = employeeRepository;
}
示例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");
}
示例6: Initialize
public void Initialize(EntityWorld entityWorld, IEntityFactory entityFactory)
{
_entityWorld = entityWorld;
EntityFactory = entityFactory;
_entityWorld.EntityManager.AddedEntityEvent += OnEntityAdded;
_entityWorld.EntityManager.RemovedEntityEvent += OnEntityRemoved;
}
示例7: AttendanceManagerModel
public AttendanceManagerModel(IEntityFactory entityFactory, IEmployeeRepository employeeRepository, IRepository<Schedule> scheduleRepository,
IAttendanceRepository attendanceRepository)
{
_entityFactory = entityFactory;
_employeeRepository = employeeRepository;
_scheduleRepository = scheduleRepository;
_attendanceRepository = attendanceRepository;
}
示例8: StaffingChartPresenter
public StaffingChartPresenter(IStaffingCalculatorModel staffingCalculatorModel,
IEntityFactory entityFactory, Schedule schedule, IStaffingCalculatorService service)
{
_schedule = schedule;
_staffingService = service;
_staffingCalculatorModel = staffingCalculatorModel;
_entityFactory = entityFactory;
}
示例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();
}
示例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);
}
示例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);
}
示例12: DefaultWorld
public DefaultWorld(
IProfiler profiler,
INetworkingSession networkSession,
IEntityFactory playerFactory,
ICurrentNode currentNode)
{
currentNode.SetName("AmazingWorld");
playerFactory.CreatePlayer("Player1");
playerFactory.CreatePlayer("Player2");
}
示例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);
}
示例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;
}
示例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);
}