public static void ProcessMapObjectCommand(DebugCommand message, MapObjectContext context, IMapObjectEntityFactory mapObjectEntityFactory, PlayerEntity player) { switch (message.Command) { case DebugCommands.ClearSceneObject: context.DestroyAllEntities(); break; case DebugCommands.ListDoorEntity: var mapEntities = context.GetEntities(); for (int i = 0; i < mapEntities.Length; ++i) { var mapEntity = mapEntities[i]; if (mapEntity.hasDoorData && mapEntity.hasRawGameObject) { var obj = mapEntity.rawGameObject.Value; string path = "/" + obj.name; while (obj.transform.parent != null) { obj = obj.transform.parent.gameObject; path = "/" + obj.name + path; } Logger.InfoFormat("DoorEntity {0} {1}", mapEntity, path); } } break; } }
public DoorCastLogic(MapObjectContext mapObjectContext, PlayerContext playerContext, IUserCmdGenerator cmdGenerator, float maxDistance) : base(playerContext, maxDistance) { _doorContext = mapObjectContext; _playerContext = playerContext; _userCmdGenerator = cmdGenerator; _triggerObjectManager = SingletonManager.Get <TriggerObjectManager>(); }
public DoorTriggerSystem(Contexts context, ITriggerObjectListener listener = null) { _listener = listener; _contexts = context; _mapContext = context.mapObject; _mapFactory = _contexts.session.entityFactoryObject.MapObjectEntityFactory; var triggerObjectManager = SingletonManager.Get <TriggerObjectManager>(); _objectManager = triggerObjectManager.GetManager(ETriggerObjectType.Door); }
public PickUpUiAdapter(PlayerContext player, SceneObjectContext sceneObject, MapObjectContext mapObject, SessionContext session, VehicleContext vehicle, FreeMoveContext freeMove, UserInputManager.Lib.UserInputManager userInputManager, UiContext uiContext) { this.player = player; this.sceneObject = sceneObject; this.mapObject = mapObject; this.session = session; this.vehicle = vehicle; this.freeMove = freeMove; this.userInputManager = userInputManager; this.uiContext = uiContext; }
public MapObjectCastLogic( PlayerContext playerContext, MapObjectContext mapObjectContext, ClientSessionObjectsComponent sessionObjectsComponent, IUserCmdGenerator cmdGenerator, float maxDistance) : base(playerContext, maxDistance) { _mapObjectContext = mapObjectContext; _sessionObjectsComponent = sessionObjectsComponent; _cmdGenerator = cmdGenerator; }
public ServerDestructibleObjectUpdateSystem(Contexts contexts) { _destructObjListener = new ServerDestructibleObjectListener(contexts); _glassyObjListener = new ServerGlassyObjectListener(contexts); _context = contexts.mapObject; _eventObjects = _context.GetGroup(MapObjectMatcher.AllOf(MapObjectMatcher.EntityKey, MapObjectMatcher.TriggerObjectId, MapObjectMatcher.TriggerObjectEvent, MapObjectMatcher.TriggerObjectEventFlag, MapObjectMatcher.RawGameObject)); _currentTime = contexts.session.currentTimeObject; }
public ClientDestructibleObjectUpdateSystem(Contexts contexts) { _destructObjListener = new ClientDestructibleObjectListener(contexts); _glassyObjListener = new ClientGlassyObjectListener(contexts); _context = contexts.mapObject; _destructibleObjects = _context.GetGroup(MapObjectMatcher.AllOf(MapObjectMatcher.EntityKey, MapObjectMatcher.TriggerObjectId, MapObjectMatcher.DestructibleData, MapObjectMatcher.RawGameObject)); _glassyObjects = _context.GetGroup(MapObjectMatcher.AllOf(MapObjectMatcher.EntityKey, MapObjectMatcher.TriggerObjectId, MapObjectMatcher.GlassyData, MapObjectMatcher.RawGameObject)); _eventObjects = _context.GetGroup(MapObjectMatcher.AllOf(MapObjectMatcher.EntityKey, MapObjectMatcher.TriggerObjectId, MapObjectMatcher.TriggerObjectEvent, MapObjectMatcher.TriggerObjectEventFlag, MapObjectMatcher.RawGameObject)); _sessionObjects = contexts.session.clientSessionObjects; }
public static string ListTriggerObj(MapObjectContext context, string[] args) { var position = new Vector3( float.Parse(args[0]), float.Parse(args[1]), float.Parse(args[2]) ); StringBuilder sb = new StringBuilder(); sb.Append("TriggerObjList:\n"); var site = position; float radius = 25f; foreach (var MapObj in context.GetEntities()) { if (MapObj == null) { continue; } if ((MapObj.position.Value - site).magnitude <= radius) { if (!MapObj.hasRawGameObject || MapObj.rawGameObject.Value == null) { continue; } //sb.AppendFormat("EntityWithoutRaw:{0}, Pos:[{1}]\n", MapObj.GetType(), MapObj.position.Value); sb.AppendFormat("Entity:{0}, Pos:[{1}]\n", MapObj.rawGameObject.Value.name, MapObj.position.Value); } } var result = sb.ToString(); _logger.ErrorFormat("Time={0}, {1}", MyGameTime.time, result); return(result); }
public ServerMapObjectEntityFactory(MapObjectContext mapObjectContext, IEntityIdGenerator entityIdGenerator) { _mapObjectContext = mapObjectContext; _idGenerator = entityIdGenerator; }
/// <summary> /// Constructor. Setting the context for repository. /// </summary> /// <param name="context">Context for connect to database.</param> public RoleRepository(MapObjectContext context) { db = context; }
public DoorTriggerSystem(MapObjectContext context) { _context = context; }
/// <summary> /// Constructor. Setting the context for repository. /// </summary> /// <param name="context">Context for connect to database.</param> public UserRepository(MapObjectContext context) { db = context; }
/// <summary> /// Constructor. Setting the context for repository. /// </summary> /// <param name="context">Context for connect to database.</param> public TagRepository(MapObjectContext context) { db = context; }
/// <summary> /// Constructor. Accept the connection string. /// </summary> /// <param name="connectionString">Connection string from MapsProject.WEB</param> public EFUnitOfWork(string connectionString) { db = new MapObjectContext(connectionString); }
public ClientMapObjectEntityFactory(MapObjectContext mapObjectContext, IEntityIdGenerator entityIdGenerator) : base(mapObjectContext, entityIdGenerator) { }