コード例 #1
0
ファイル: PickingManager.cs プロジェクト: ErtyHackward/utopia
        public PickingManager(IWorldChunks worldChunks,
                              ICameraManager cameraManager,
                              InputsManager inputsManager,
                              SingleArrayChunkContainer cubesHolder,
                              WorldConfiguration worldConfiguration)
        {
            if (worldChunks == null)
            {
                throw new ArgumentNullException("worldChunks");
            }
            if (cameraManager == null)
            {
                throw new ArgumentNullException("cameraManager");
            }
            if (inputsManager == null)
            {
                throw new ArgumentNullException("inputsManager");
            }
            if (cubesHolder == null)
            {
                throw new ArgumentNullException("cubesHolder");
            }
            if (worldConfiguration == null)
            {
                throw new ArgumentNullException("worldConfiguration");
            }

            _worldChunks        = worldChunks;
            _cameraManager      = cameraManager;
            _inputsManager      = inputsManager;
            _cubesHolder        = cubesHolder;
            _worldConfiguration = worldConfiguration;

            ShowDebugInfo = true;
        }
コード例 #2
0
        public CracksRenderer(D3DEngine engine,
                              CameraManager <ICameraFocused> cameraManager,
                              IWorldChunks worldChunks,
                              SingleArrayChunkContainer cubesHolder,
                              ISkyDome skyDome
                              )
        {
            if (engine == null)
            {
                throw new ArgumentNullException("engine");
            }
            if (cameraManager == null)
            {
                throw new ArgumentNullException("cameraManager");
            }
            if (worldChunks == null)
            {
                throw new ArgumentNullException("worldChunks");
            }

            _engine        = engine;
            _cameraManager = cameraManager;
            _worldChunks   = worldChunks;
            _cubesHolder   = cubesHolder;
            _skyDome       = skyDome;

            this.DrawOrders.UpdateIndex(0, 1010);
        }
コード例 #3
0
        public CubeEmitter(string cubeTexturePath,
                           string fileNamePatern,
                           string biomeColorFilePath,
                           float maximumAge,
                           float size,
                           VisualWorldParameters visualWorldParameters,
                           IWorldChunks worldChunk,
                           ILandscapeManager landscapeManager,
                           double maxRenderingDistance,
                           IWeather weather)
        {
            if (landscapeManager == null)
            {
                throw new ArgumentNullException("landscapeManager");
            }

            _cubeColorSampled      = new Dictionary <int, Color[]>();
            _fileNamePatern        = fileNamePatern;
            _cubeTexturePath       = cubeTexturePath;
            _visualWorldParameters = visualWorldParameters;
            _biomeColorFilePath    = biomeColorFilePath;
            _weather             = weather;
            MaxRenderingDistance = maxRenderingDistance;
            _worldChunk          = worldChunk;
            _landscapeManager    = landscapeManager;
            _isStopped           = false;
            _maximumAge          = maximumAge;
            _particules          = new List <ColoredParticule>();

            _rnd = new FastRandom();

            _cubeBB = new BoundingBox(new Vector3(-size / 2.0f, -size / 2.0f, -size / 2.0f), new Vector3(size / 2.0f, size / 2.0f, size / 2.0f));
        }
コード例 #4
0
 public SyncManager(IVisualDynamicEntityManager dynamicEntityManager,
                    ServerComponent server,
                    IWorldChunks chunks,
                    ChatComponent chat)
 {
     _dynamicEntityManager = dynamicEntityManager;
     _server = server;
     _chunks = chunks;
     _chat   = chat;
     _server.MessageError      += _server_MessageError;
     _server.MessageEntityData += server_MessageEntityData;
 }
コード例 #5
0
 public RealmGameSoundManager(ISoundEngine soundEngine,
                              CameraManager <ICameraFocused> cameraManager,
                              SingleArrayChunkContainer singleArray,
                              IVisualDynamicEntityManager dynamicEntityManager,
                              IChunkEntityImpactManager chunkEntityImpactManager,
                              IWorldChunks worldChunk,
                              IClock gameClockTime,
                              PlayerEntityManager playerEntityManager,
                              VisualWorldParameters visualWorldParameters,
                              IClock worlClock)
     : base(soundEngine, cameraManager, singleArray, dynamicEntityManager, chunkEntityImpactManager, worldChunk, gameClockTime, playerEntityManager, visualWorldParameters, worlClock)
 {
     PreLoadSound("Hurt", @"Sounds\Events\hurt.adpcm.wav", 0.3f, 16.0f, 100);
     PreLoadSound("Dying", @"Sounds\Events\dying.adpcm.wav", 0.5f, 16.0f, 1000);
 }
コード例 #6
0
        public WeatherContainer(D3DEngine d3DEngine,
                                IWeather weather,
                                IWorldChunks worldChunks,
                                PlayerEntityManager playerEntityManager)
        {
            _d3DEngine           = d3DEngine;
            _weather             = weather;
            _topPanelheight      = 100;
            _worldChunks         = worldChunks;
            _playerEntityManager = playerEntityManager;

            _d3DEngine.ScreenSize_Updated += ScreenSize_Updated;

            RefreshSize(_d3DEngine.ViewPort);
            CreateChildsComponents();
        }
コード例 #7
0
ファイル: RealmsHud.cs プロジェクト: ErtyHackward/utopia
        public RealmsHud(MainScreen screen,
                         D3DEngine d3DEngine,
                         ToolBarUi toolbar,
                         InputsManager inputManager,
                         CameraManager <ICameraFocused> camManager,
                         PlayerEntityManager playerEntityManager,
                         IWeather weather,
                         IWorldChunks worldChunks
                         ) :
            base(screen, d3DEngine, toolbar, inputManager, camManager, playerEntityManager, weather, worldChunks)
        {
            _screen    = screen;
            _d3DEngine = d3DEngine;

            _d3DEngine.ScreenSize_Updated += UpdateLayout;
        }
コード例 #8
0
 public AdminConsole(ChatComponent chatComp,
                     IWorldChunks worldChunk,
                     D3DEngine engine,
                     Game mainGameLoop,
                     ServerComponent server,
                     IClock gameClock)
 {
     _chatComp             = chatComp;
     _chatComp.Console     = this;
     _worldChunk           = worldChunk;
     _engine               = engine;
     _mainGameLoop         = mainGameLoop;
     _server               = server;
     _gameClock            = gameClock;
     _chatComp.MessageOut += _chatComp_MessageOut;
 }
コード例 #9
0
        public GameSoundManager(ISoundEngine soundEngine,
                                CameraManager <ICameraFocused> cameraManager,
                                SingleArrayChunkContainer singleArray,
                                IVisualDynamicEntityManager dynamicEntityManager,
                                IChunkEntityImpactManager chunkEntityImpactManager,
                                IWorldChunks worldChunk,
                                IClock gameClockTime,
                                PlayerEntityManager playerEntityManager,
                                VisualWorldParameters visualWorldParameters,
                                IClock worlClock)
        {
            _cameraManager            = cameraManager;
            _soundEngine              = soundEngine;
            _singleArray              = singleArray;
            _worldChunk               = worldChunk;
            _chunkEntityImpactManager = chunkEntityImpactManager;
            _gameClockTime            = gameClockTime;
            _playerEntityManager      = playerEntityManager;
            _visualWorldParameters    = visualWorldParameters;
            _worlClock = worlClock;
            if (visualWorldParameters.WorldParameters.Configuration is UtopiaWorldConfiguration)
            {
                _biomesParams = ((UtopiaWorldConfiguration)visualWorldParameters.WorldParameters.Configuration).ProcessorParam;
            }

            _dynamicEntityManager = dynamicEntityManager;
            _stepsTracker.Add(new DynamicEntitySoundTrack {
                Entity = _playerEntityManager.Player, Position = _playerEntityManager.Player.Position, isLocalSound = true
            });
            _playerEntityManager.PlayerEntityChanged += _playerEntityManager_PlayerEntityChanged;

            //Register to Events

            _dynamicEntityManager.EntityAdded             += DynamicEntityManagerEntityAdded;
            _dynamicEntityManager.EntityRemoved           += DynamicEntityManagerEntityRemoved;
            _chunkEntityImpactManager.BlockReplaced       += _chunkEntityImpactManager_BlockReplaced;
            _chunkEntityImpactManager.StaticEntityAdd     += StaticEntityAdd;
            _chunkEntityImpactManager.StaticEntityRemoved += StaticEntityRemoved;

            _rnd        = new FastRandom();
            MoodsSounds = new Dictionary <MoodSoundKey, List <IUtopiaSoundSource> >();

            IsDefferedLoadContent = true; //Make LoadContent executed in thread
        }
コード例 #10
0
        public void LateInitialization(ServerComponent server,
                                       SingleArrayChunkContainer cubesHolder,
                                       IWorldChunks worldChunks,
                                       IChunkStorageManager chunkStorageManager,
                                       ILightingManager lightManager,
                                       VisualWorldParameters visualWorldParameters
                                       )
        {
            _server                     = server;
            _lightManager               = lightManager;
            _worldChunks                = worldChunks;
            _chunkStorageManager        = chunkStorageManager;
            _server.MessageBlockChange += ServerConnection_MessageBlockChange;
            _visualWorldParameters      = visualWorldParameters;
            _wp          = _visualWorldParameters.WorldParameters;
            _cubesHolder = cubesHolder;


            _initialized = true;
        }
コード例 #11
0
        public DynamicEntityManager(D3DEngine d3DEngine,
                                    VoxelModelManager voxelModelManager,
                                    CameraManager <ICameraFocused> camManager,
                                    WorldFocusManager worldFocusManager,
                                    VisualWorldParameters visualWorldParameters,
                                    SingleArrayChunkContainer chunkContainer,
                                    IPlayerManager playerEntityManager,
                                    ISkyDome skyDome,
                                    SharedFrameCB sharedFrameCB,
                                    IWorldChunks worldChunks,
                                    ISoundEngine soundEngine,
                                    UtopiaParticuleEngine utopiaParticuleEngine
                                    )
        {
            _d3DEngine             = d3DEngine;
            _voxelModelManager     = voxelModelManager;
            _camManager            = camManager;
            _chunkContainer        = chunkContainer;
            _soundEngine           = soundEngine;
            _worldFocusManager     = worldFocusManager;
            _visualWorldParameters = visualWorldParameters;
            _playerEntityManager   = playerEntityManager;
            _playerEntityManager.UtopiaParticuleEngine = utopiaParticuleEngine;
            _skyDome               = skyDome;
            _sharedFrameCB         = sharedFrameCB;
            _worldChunks           = worldChunks;
            _utopiaParticuleEngine = utopiaParticuleEngine;

            _voxelModelManager.VoxelModelAvailable += VoxelModelManagerVoxelModelReceived;
            _camManager.ActiveCameraChanged        += CamManagerActiveCameraChanged;

            _playerEntityManager.PlayerEntityChanged += _playerEntityManager_PlayerEntityChanged;

            DynamicEntities = new List <VisualVoxelEntity>();

            DrawOrders.UpdateIndex(VOXEL_DRAW, 99, "VOXEL_DRAW");
            SPRITENAME_DRAW = DrawOrders.AddIndex(1060, "NAME_DRAW");

            this.IsDefferedLoadContent = true;
        }
コード例 #12
0
        public Hud(MainScreen screen,
                   D3DEngine d3DEngine,
                   ToolBarUi toolbar,
                   InputsManager inputManager,
                   CameraManager <ICameraFocused> camManager,
                   PlayerEntityManager playerEntityManager,
                   IWeather weather,
                   IWorldChunks worldChunks)
        {
            IsDefferedLoadContent = true;

            _screen              = screen;
            _inputManager        = inputManager;
            _playerEntityManager = playerEntityManager;

            _d3DEngine = d3DEngine;
            DrawOrders.UpdateIndex(0, 10000);
            _d3DEngine.ScreenSize_Updated += D3DEngineViewPortUpdated;
            ToolbarUi           = toolbar;
            toolbar.LayoutFlags = ControlLayoutFlags.Skip;
            _camManager         = camManager;

            _inputManager.KeyboardManager.IsRunning = true;
            IsHidden = false;

            _tooltip                   = new TooltipControl();
            _energyBar                 = new EnergyBarsContainer(d3DEngine, playerEntityManager);
            _energyBar.LayoutFlags     = ControlLayoutFlags.Skip;
            _energyBar.Bounds.Location = new UniVector(0, 0); //Always bound to top left location of the screen !

            _weatherContainer                 = new WeatherContainer(d3DEngine, weather, worldChunks, playerEntityManager);
            _weatherContainer.LayoutFlags     = ControlLayoutFlags.Skip;
            _weatherContainer.Bounds.Location = new UniVector(0, 0); //Always bound to top left location of the screen !

            _screen.ToolTipShow += _screen_ToolTipShow;
            _screen.ToolTipHide += _screen_ToolTipHide;
        }
コード例 #13
0
        public UtopiaParticuleEngine(D3DEngine d3dEngine,
                                     SharedFrameCB sharedFrameCB,
                                     CameraManager <ICameraFocused> cameraManager,
                                     InputsManager inputsManager,
                                     VisualWorldParameters worldParameters,
                                     IChunkEntityImpactManager chunkEntityImpactManager,
                                     IWorldChunks worldChunks,
                                     ILandscapeManager landscapeManager,
                                     IWeather weather)
            : base(d3dEngine, sharedFrameCB.CBPerFrame)
        {
            _sharedFrameCB            = sharedFrameCB;
            _cameraManager            = cameraManager;
            _inputsManager            = inputsManager;
            _worldParameters          = worldParameters;
            _chunkEntityImpactManager = chunkEntityImpactManager;
            _worldChunks      = worldChunks;
            _landscapeManager = landscapeManager;
            _weather          = weather;

            _chunkEntityImpactManager.BlockReplaced += _chunkEntityImpactManager_BlockReplaced;

            this.IsDefferedLoadContent = true;
        }