Example #1
0
 public void VolumeTest()
 {
     Control control = null; // TODO: Passenden Wert initialisieren
     GameManager manager = null; // TODO: Passenden Wert initialisieren
     Renderer target = new Renderer(control, manager); // TODO: Passenden Wert initialisieren
     DynamicRangeChunkVolume actual;
     actual = target.Volume;
     Assert.Inconclusive("Überprüfen Sie die Richtigkeit dieser Testmethode.");
 }
Example #2
0
 public void AddChatHistoryTest()
 {
     Control control = null; // TODO: Passenden Wert initialisieren
     GameManager manager = null; // TODO: Passenden Wert initialisieren
     Renderer target = new Renderer(control, manager); // TODO: Passenden Wert initialisieren
     string line = string.Empty; // TODO: Passenden Wert initialisieren
     target.AddChatHistory(line);
     Assert.Inconclusive("Eine Methode, die keinen Wert zurückgibt, kann nicht überprüft werden.");
 }
Example #3
0
        public GameManager()
        {
            Static.Window.KeyDown += KeyDown;
            Static.Window.KeyUp += KeyUp;
            Static.Window.KeyPress += KeyPress;
            Static.Window.MouseWheel += MouseWheel;
            Static.RenderTarget.MouseDown += MouseDown;
            Static.RenderTarget.MouseUp += MouseUp;
            this.dataProvider = Static.DataProvider;

            renderer = Static.Renderer;
            walk = new WalkManager(this);

            me = new DPerson(dataProvider.Username);
            me.DontDrawMyOwn = true;

            HelpfulStuff.RunPeriodic(Update, () => Static.Paused ? 100 : 20);
            HelpfulStuff.RunPeriodic(Sync, 1000);
        }
Example #4
0
        public static void InitGame(Control renderTarget, string ip, string username, string password)
        {
            indices = new ushort[16384 * 6];
            for (ushort i = 0; i < 16384; i++)
            {
                indices[6 * i + 0] = (ushort)(4 * i + 0);
                indices[6 * i + 1] = (ushort)(4 * i + 1);
                indices[6 * i + 2] = (ushort)(4 * i + 2);
                indices[6 * i + 3] = (ushort)(4 * i + 2);
                indices[6 * i + 4] = (ushort)(4 * i + 1);
                indices[6 * i + 5] = (ushort)(4 * i + 3);
            }

            //PREPARE PHASE
            //DataProvider
            DataProvider = new MultiPlayerDataProvider(() =>
            {
                TcpClient tc = new TcpClient();
                tc.Connect(ip, 8080);
                return tc;
            }, username, "joch");

            //UserData: DataProvider
            UserData = DataProvider.Login();

            //RenderTarget
            RenderTarget = renderTarget;
            
            //Window
            Window = renderTarget.TopLevelControl as Form;

            //SoundManager: Window
            //SoundManager.PlayForever();

            //Device: RenderTarget
            Device = Renderer.CreateDevice();

            var ib = new IndexBuffer(Device, IndexElementSize.SixteenBits, indices.Length, BufferUsage.WriteOnly);
            ib.SetData<ushort>(indices);
            Indices = ib;

            //DPerson: Device
            DPerson.Init();

            //GraphicsHelper: Device
            GraphicsHelper.Init();

            //Effect: Device
            Effect = new AwesomeEffect();

            //Volume: Device, DataProvider, Effect
            Volume = new DynamicRangeChunkVolume(Device, DataProvider);

            //Renderer: Window, Effect, RenderTarget, Device, Volume
            Renderer = new Renderer();

            //GameManager: RenderTarget, Window, Renderer, Volume
            GameManager = new GameManager();

            //RUN PHASE
            DataProvider.Start();
            Renderer.Start();
            Paused = false;
        }
Example #5
0
 public static void InitLayerRendering()
 {
     renderer = Static.Renderer;
     renderer.GraphicsEffect.AmbientLightColor = Color.White.ToVector4();
     proj = Matrix.CreateScale(-1,1,1) * Matrix.CreateOrthographic(renderer.GraphicsDevice.Viewport.Width, renderer.GraphicsDevice.Viewport.Height, 0.1f, 1) * Matrix.CreateLookAt(Vector3.Zero, Vector3.UnitZ, Vector3.UnitY);
 }
Example #6
0
 public void SetFogTest()
 {
     Control control = null; // TODO: Passenden Wert initialisieren
     GameManager manager = null; // TODO: Passenden Wert initialisieren
     Renderer target = new Renderer(control, manager); // TODO: Passenden Wert initialisieren
     int distance = 0; // TODO: Passenden Wert initialisieren
     target.SetFog(distance);
     Assert.Inconclusive("Eine Methode, die keinen Wert zurückgibt, kann nicht überprüft werden.");
 }
Example #7
0
 public void ScreenShotTest()
 {
     Control control = null; // TODO: Passenden Wert initialisieren
     GameManager manager = null; // TODO: Passenden Wert initialisieren
     Renderer target = new Renderer(control, manager); // TODO: Passenden Wert initialisieren
     Bitmap actual;
     actual = target.ScreenShot;
     Assert.Inconclusive("Überprüfen Sie die Richtigkeit dieser Testmethode.");
 }
Example #8
0
 public void RenderingTest()
 {
     Control control = null; // TODO: Passenden Wert initialisieren
     GameManager manager = null; // TODO: Passenden Wert initialisieren
     Renderer target = new Renderer(control, manager); // TODO: Passenden Wert initialisieren
     bool expected = false; // TODO: Passenden Wert initialisieren
     bool actual;
     target.Rendering = expected;
     actual = target.Rendering;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Überprüfen Sie die Richtigkeit dieser Testmethode.");
 }
Example #9
0
 public void RendererConstructorTest()
 {
     Control control = null; // TODO: Passenden Wert initialisieren
     GameManager manager = null; // TODO: Passenden Wert initialisieren
     Renderer target = new Renderer(control, manager);
     Assert.Inconclusive("TODO: Code zum Überprüfen des Ziels implementieren");
 }
Example #10
0
 public void GraphicsEffectTest()
 {
     Control control = null; // TODO: Passenden Wert initialisieren
     GameManager manager = null; // TODO: Passenden Wert initialisieren
     Renderer target = new Renderer(control, manager); // TODO: Passenden Wert initialisieren
     AwesomeEffect actual;
     actual = target.GraphicsEffect;
     Assert.Inconclusive("Überprüfen Sie die Richtigkeit dieser Testmethode.");
 }
Example #11
0
        public static void InitGame(Control renderTarget, string ip, string username, string password)
        {
            //PREPARE PHASE
            //DataProvider
            DataProvider = new MultiPlayerDataProvider(() =>
            {
                TcpClient tc = new TcpClient();
                tc.Connect(ip, 8080);
                return tc;
            }, username, "joch");

            //UserData: DataProvider
            UserData = DataProvider.Login();

            //RenderTarget
            RenderTarget = renderTarget;

            //Window
            Window = renderTarget.TopLevelControl as Form;

            //SoundManager: Window
            SoundManager.PlayForever();

            //Device: RenderTarget
            Device = Renderer.CreateDevice();

            //DPerson: Device
            DPerson.Init();

            //GraphicsHelper: Device
            GraphicsHelper.Init();

            //Effect: Device
            Effect = new AwesomeEffect();

            //Volume: Device, DataProvider, Effect
            Volume = new DynamicRangeChunkVolume(Device, DataProvider);

            //Renderer: Window, Effect, RenderTarget, Device, Volume
            Renderer = new Renderer();

            //GameManager: RenderTarget, Window, Renderer, Volume
            GameManager = new GameManager();

            //RUN PHASE
            DataProvider.Start();
            Renderer.Start();
            Paused = false;
        }