示例#1
0
        public static void AddStrategyLogicSystems(World world, EntityRepresentationMapping entityRepresentationMapping)
        {
            TransformSynchronizationHelper.AddServerSystems(world);
            PlayerLifecycleHelper.AddServerSystems(world);
            GameObjectCreationHelper.EnableStandardGameObjectCreation(world, entityRepresentationMapping);

            world.GetOrCreateSystem <ProcessLaunchCommandSystem>();
            world.GetOrCreateSystem <MetricSendSystem>();
            //world.GetOrCreateSystem<ArmyCloudUpdateSystem>();
        }
示例#2
0
        public static void EnableStandardGameObjectCreation(World world, EntityRepresentationMapping entityRepresentationMapping, GameObject workerGameObject = null)
        {
            var workerSystem = world.GetExistingSystem <WorkerSystem>();

            if (workerSystem == null)
            {
                throw new InvalidOperationException(WorkerNotCreatedErrorMessage);
            }

            var creator = new GameObjectCreatorFromMetadata(workerSystem.WorkerType, workerSystem.Origin);

            EnableStandardGameObjectCreation(world, creator, entityRepresentationMapping, workerGameObject);
        }
示例#3
0
        public static void AddGameLogicSystems(World world, EntityRepresentationMapping entityRepresentationMapping)
        {
            AddLifecycleSystems(world);
            TransformSynchronizationHelper.AddServerSystems(world);
            PlayerLifecycleHelper.AddServerSystems(world);
            GameObjectCreationHelper.EnableStandardGameObjectCreation(world, entityRepresentationMapping);

            world.GetOrCreateSystem <TriggerColorChangeSystem>();
            world.GetOrCreateSystem <ProcessLaunchCommandSystem>();
            world.GetOrCreateSystem <ProcessRechargeSystem>();
            world.GetOrCreateSystem <MetricSendSystem>();
            world.GetOrCreateSystem <ProcessScoresSystem>();
            world.GetOrCreateSystem <CollisionProcessSystem>();
            world.GetOrCreateSystem <CubeMovementSystem>();
        }
示例#4
0
 public static void AddClientSystems(World world, EntityRepresentationMapping entityRepresentationMapping)
 {
     AddLifecycleSystems(world);
     TransformSynchronizationHelper.AddClientSystems(world);
     PlayerLifecycleHelper.AddClientSystems(world);
     GameObjectCreationHelper.EnableStandardGameObjectCreation(world, entityRepresentationMapping);
     world.GetOrCreateSystem <ProcessColorChangeSystem>();
     world.GetOrCreateSystem <LocalPlayerInputSync>();
     world.GetOrCreateSystem <MoveLocalPlayerSystem>();
     world.GetOrCreateSystem <InitCameraSystem>();
     world.GetOrCreateSystem <FollowCameraSystem>();
     world.GetOrCreateSystem <UpdateUISystem>();
     world.GetOrCreateSystem <PlayerCommandsSystem>();
     world.GetOrCreateSystem <MetricSendSystem>();
 }
示例#5
0
        public static void EnableStandardGameObjectCreation(World world, IEntityGameObjectCreator creator, EntityRepresentationMapping entityRepresentationMapping,
                                                            GameObject workerGameObject = null)
        {
            var workerSystem = world.GetExistingSystem <WorkerSystem>();

            if (workerSystem == null)
            {
                throw new InvalidOperationException(WorkerNotCreatedErrorMessage);
            }

            if (world.GetExistingSystem <GameObjectInitializationSystem>() != null)
            {
                workerSystem.LogDispatcher.HandleLog(LogType.Error, new LogEvent(
                                                         "You should only call EnableStandardGameobjectCreation() once on worker setup")
                                                     .WithField(LoggingUtils.LoggerName, nameof(GameObjectCreationHelper)));
                return;
            }

            world.AddSystem(new GameObjectInitializationSystem(creator, entityRepresentationMapping, workerGameObject));
        }