Exemplo n.º 1
0
        private IEntityActorStateInitializeMessage <DefaultGameObjectActorState> CreateDefaultInitializationState(NetworkEntityGuid entityGuid)
        {
            GameObjectTemplateModel templateModel = GameObjectDataContainer.GameObjectTemplateMappable.RetrieveEntity(entityGuid);
            GameObjectInstanceModel instanceModel = GameObjectDataContainer.GameObjectInstanceMappable.RetrieveEntity(entityGuid);

            return(new EntityActorStateInitializeMessage <DefaultGameObjectActorState>(new DefaultGameObjectActorState(EntityDataMappable.RetrieveEntity(entityGuid), entityGuid, instanceModel, templateModel, InterestMappable.RetrieveEntity(entityGuid))));
        }
Exemplo n.º 2
0
        private EntityActorStateInitializeMessage <BehaviourGameObjectState <TBehaviourType> > CreateState <TBehaviourType>(NetworkEntityGuid entityGuid)
            where TBehaviourType : class, IGameObjectLinkable
        {
            GameObjectTemplateModel templateModel = GameObjectDataContainer.GameObjectTemplateMappable.RetrieveEntity(entityGuid);
            GameObjectInstanceModel instanceModel = GameObjectDataContainer.GameObjectInstanceMappable.RetrieveEntity(entityGuid);

            return(new EntityActorStateInitializeMessage <BehaviourGameObjectState <TBehaviourType> >(new BehaviourGameObjectState <TBehaviourType>(EntityDataMappable.RetrieveEntity(entityGuid), entityGuid, instanceModel, templateModel, GameObjectDataContainer.GetBehaviourInstanceData <TBehaviourType>(entityGuid), InterestMappable.RetrieveEntity(entityGuid))));
        }
Exemplo n.º 3
0
 public DefaultGameObjectActorState([NotNull] IEntityDataFieldContainer entityData,
                                    [NotNull] NetworkEntityGuid entityGuid,
                                    [NotNull] GameObjectInstanceModel instanceModel,
                                    [NotNull] GameObjectTemplateModel templateModel,
                                    [NotNull] InterestCollection interest)
     : base(entityData, entityGuid, interest)
 {
     InstanceModel = instanceModel ?? throw new ArgumentNullException(nameof(instanceModel));
     TemplateModel = templateModel ?? throw new ArgumentNullException(nameof(templateModel));
 }
Exemplo n.º 4
0
        protected override void OnGameObjectEntityCreationStarting(EntityCreationStartingEventArgs args)
        {
            //We do nothing if something has already initialized the movement.
            if (MovementDataMappable.ContainsKey(args.EntityGuid))
            {
                return;
            }

            GameObjectInstanceModel instanceModel = GameObjectInstanceModelMappable.RetrieveEntity(args.EntityGuid);

            MovementDataMappable.AddObject(args.EntityGuid, new PositionChangeMovementData(0, instanceModel.InitialPosition, Vector2.zero, instanceModel.YAxisRotation));
        }
Exemplo n.º 5
0
 public async Task UpdateGameObjectInstance(int gameObjectId, GameObjectInstanceModel model)
 {
     await(await GetService().ConfigureAwaitFalse()).UpdateGameObjectInstance(gameObjectId, model).ConfigureAwaitFalseVoid();
 }
Exemplo n.º 6
0
 public BehaviourGameObjectState(IEntityDataFieldContainer entityData, NetworkEntityGuid entityGuid, GameObjectInstanceModel instanceModel, GameObjectTemplateModel templateModel,
                                 [NotNull] TBehaviourType behaviourData, [NotNull] InterestCollection interest)
     : base(entityData, entityGuid, instanceModel, templateModel, interest)
 {
     BehaviourData = behaviourData ?? throw new ArgumentNullException(nameof(behaviourData));
 }