Fixed bug in move and bomb messages.
authorRiMa <s1810567015@students.fh-hagenberg.at>
Tue, 11 Dec 2018 12:41:34 +0000 (13:41 +0100)
committerRiMa <s1810567015@students.fh-hagenberg.at>
Tue, 11 Dec 2018 12:41:34 +0000 (13:41 +0100)
src/communication/ConnectionTest/ConnectionTest.sln
src/communication/ConnectionTest/ConnectionTest/ConnectionTest.UWP/ConnectionTest.UWP.csproj.user
src/communication/ConnectionTest/ConnectionTest/ConnectionTest/MainPage.xaml.cs

index b7bbe44..6a6a137 100644 (file)
@@ -9,7 +9,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConnectionTest.iOS", "Conne
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConnectionTest.UWP", "ConnectionTest\ConnectionTest.UWP\ConnectionTest.UWP.csproj", "{FC2C0FB1-191D-49F4-8480-3E77EA238C71}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConnectionTest", "ConnectionTest\ConnectionTest\ConnectionTest.csproj", "{EC284AFF-4718-4953-8086-AF504176F092}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConnectionTest", "ConnectionTest\ConnectionTest\ConnectionTest.csproj", "{EC284AFF-4718-4953-8086-AF504176F092}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpJsonConnectionTest", "TcpJsonConnectionTest\TcpJsonConnectionTest.csproj", "{E1441C15-03B8-46B1-A9FD-7891F108C68E}"
 EndProject
@@ -223,9 +223,9 @@ Global
                {FC2C0FB1-191D-49F4-8480-3E77EA238C71}.AppStore|x86.ActiveCfg = Release|x86
                {FC2C0FB1-191D-49F4-8480-3E77EA238C71}.AppStore|x86.Build.0 = Release|x86
                {FC2C0FB1-191D-49F4-8480-3E77EA238C71}.AppStore|x86.Deploy.0 = Release|x86
-               {FC2C0FB1-191D-49F4-8480-3E77EA238C71}.Debug|Any CPU.ActiveCfg = Debug|x86
-               {FC2C0FB1-191D-49F4-8480-3E77EA238C71}.Debug|Any CPU.Build.0 = Debug|x86
-               {FC2C0FB1-191D-49F4-8480-3E77EA238C71}.Debug|Any CPU.Deploy.0 = Debug|x86
+               {FC2C0FB1-191D-49F4-8480-3E77EA238C71}.Debug|Any CPU.ActiveCfg = Release|x86
+               {FC2C0FB1-191D-49F4-8480-3E77EA238C71}.Debug|Any CPU.Build.0 = Release|x86
+               {FC2C0FB1-191D-49F4-8480-3E77EA238C71}.Debug|Any CPU.Deploy.0 = Release|x86
                {FC2C0FB1-191D-49F4-8480-3E77EA238C71}.Debug|ARM.ActiveCfg = Debug|ARM
                {FC2C0FB1-191D-49F4-8480-3E77EA238C71}.Debug|ARM.Build.0 = Debug|ARM
                {FC2C0FB1-191D-49F4-8480-3E77EA238C71}.Debug|ARM.Deploy.0 = Debug|ARM
@@ -313,9 +313,9 @@ Global
                {EC284AFF-4718-4953-8086-AF504176F092}.Debug|x86.ActiveCfg = Debug|Any CPU
                {EC284AFF-4718-4953-8086-AF504176F092}.Debug|x86.Build.0 = Debug|Any CPU
                {EC284AFF-4718-4953-8086-AF504176F092}.Debug|x86.Deploy.0 = Debug|Any CPU
-               {EC284AFF-4718-4953-8086-AF504176F092}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {EC284AFF-4718-4953-8086-AF504176F092}.Release|Any CPU.Build.0 = Release|Any CPU
-               {EC284AFF-4718-4953-8086-AF504176F092}.Release|Any CPU.Deploy.0 = Release|Any CPU
+               {EC284AFF-4718-4953-8086-AF504176F092}.Release|Any CPU.ActiveCfg = Debug|Any CPU
+               {EC284AFF-4718-4953-8086-AF504176F092}.Release|Any CPU.Build.0 = Debug|Any CPU
+               {EC284AFF-4718-4953-8086-AF504176F092}.Release|Any CPU.Deploy.0 = Debug|Any CPU
                {EC284AFF-4718-4953-8086-AF504176F092}.Release|ARM.ActiveCfg = Release|Any CPU
                {EC284AFF-4718-4953-8086-AF504176F092}.Release|ARM.Build.0 = Release|Any CPU
                {EC284AFF-4718-4953-8086-AF504176F092}.Release|ARM.Deploy.0 = Release|Any CPU
@@ -355,8 +355,8 @@ Global
                {E1441C15-03B8-46B1-A9FD-7891F108C68E}.AppStore|x64.Build.0 = Release|Any CPU
                {E1441C15-03B8-46B1-A9FD-7891F108C68E}.AppStore|x86.ActiveCfg = Release|Any CPU
                {E1441C15-03B8-46B1-A9FD-7891F108C68E}.AppStore|x86.Build.0 = Release|Any CPU
-               {E1441C15-03B8-46B1-A9FD-7891F108C68E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {E1441C15-03B8-46B1-A9FD-7891F108C68E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {E1441C15-03B8-46B1-A9FD-7891F108C68E}.Debug|Any CPU.ActiveCfg = Release|Any CPU
+               {E1441C15-03B8-46B1-A9FD-7891F108C68E}.Debug|Any CPU.Build.0 = Release|Any CPU
                {E1441C15-03B8-46B1-A9FD-7891F108C68E}.Debug|ARM.ActiveCfg = Debug|Any CPU
                {E1441C15-03B8-46B1-A9FD-7891F108C68E}.Debug|ARM.Build.0 = Debug|Any CPU
                {E1441C15-03B8-46B1-A9FD-7891F108C68E}.Debug|iPhone.ActiveCfg = Debug|Any CPU
@@ -403,8 +403,8 @@ Global
                {1C7AEB96-3A69-41A8-BACD-05C2047EC5D6}.AppStore|x64.Build.0 = Release|Any CPU
                {1C7AEB96-3A69-41A8-BACD-05C2047EC5D6}.AppStore|x86.ActiveCfg = Release|Any CPU
                {1C7AEB96-3A69-41A8-BACD-05C2047EC5D6}.AppStore|x86.Build.0 = Release|Any CPU
-               {1C7AEB96-3A69-41A8-BACD-05C2047EC5D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {1C7AEB96-3A69-41A8-BACD-05C2047EC5D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {1C7AEB96-3A69-41A8-BACD-05C2047EC5D6}.Debug|Any CPU.ActiveCfg = Release|Any CPU
+               {1C7AEB96-3A69-41A8-BACD-05C2047EC5D6}.Debug|Any CPU.Build.0 = Release|Any CPU
                {1C7AEB96-3A69-41A8-BACD-05C2047EC5D6}.Debug|ARM.ActiveCfg = Debug|Any CPU
                {1C7AEB96-3A69-41A8-BACD-05C2047EC5D6}.Debug|ARM.Build.0 = Debug|Any CPU
                {1C7AEB96-3A69-41A8-BACD-05C2047EC5D6}.Debug|iPhone.ActiveCfg = Debug|Any CPU
index f92aef0..54c6423 100644 (file)
@@ -2,7 +2,7 @@
 <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
     <CreateCleanLayout>true</CreateCleanLayout>
-    <RemoteDebugEnabled>true</RemoteDebugEnabled>
+    <RemoteDebugEnabled>false</RemoteDebugEnabled>
     <RemoteDebugMachine>localhost</RemoteDebugMachine>
   </PropertyGroup>
   <PropertyGroup>
index 7dc03f8..f763beb 100644 (file)
@@ -59,6 +59,7 @@ namespace Bomberman
                         horizontalLayout.Children.Add(dummy);
                         Button up = new Button();
                         up.Pressed += Up_Pressed;
+                        up.Released += Up_Released;
                         up.Text = "^";
                         horizontalLayout.Children.Add(up);
                         horizontalLayout.Children.Add(dummy);
@@ -68,15 +69,18 @@ namespace Bomberman
                         Button left = new Button();
                         left.Text = "<";
                         left.Pressed += Left_Pressed;
+                        left.Released += Left_Released;
                         horizontalLayout.Children.Add(left);
 
                         Button bomb = new Button();
                         bomb.Pressed += Bomb_Pressed;
+                        bomb.Released += Bomb_Released;
                         bomb.Text = "*";
                         horizontalLayout.Children.Add(bomb);
 
                         Button right = new Button();
                         right.Pressed += Right_Pressed;
+                        right.Released += Right_Released;
                         right.Text = ">";
                         horizontalLayout.Children.Add(right);
                         break;
@@ -85,6 +89,7 @@ namespace Bomberman
                         horizontalLayout.Children.Add(dummy);
                         Button down = new Button();
                         down.Pressed += Down_Pressed;
+                        down.Released += Down_Released;
                         down.Text = "V";
                         horizontalLayout.Children.Add(down);
                         horizontalLayout.Children.Add(dummy);
@@ -96,6 +101,31 @@ namespace Bomberman
             }
         }
 
+        private void Down_Released(object sender, EventArgs e)
+        {
+            con.SendEvent(TcpJsonConnection.InputState.Idle);
+        }
+
+        private void Right_Released(object sender, EventArgs e)
+        {
+            con.SendEvent(TcpJsonConnection.InputState.Idle);
+        }
+
+        private void Bomb_Released(object sender, EventArgs e)
+        {
+            con.SendEvent(TcpJsonConnection.InputBomb.Idle);
+        }
+
+        private void Left_Released(object sender, EventArgs e)
+        {
+            con.SendEvent(TcpJsonConnection.InputState.Idle);
+        }
+
+        private void Up_Released(object sender, EventArgs e)
+        {
+            con.SendEvent(TcpJsonConnection.InputState.Idle);
+        }
+
         private void MainPage_SizeChanged(object sender, EventArgs e)
         {
             CreateInitializePlayground(c_defaultPlaygroundSize);
@@ -162,32 +192,27 @@ namespace Bomberman
         private void Bomb_Pressed(object sender, EventArgs e)
         {
             con.SendEvent(TcpJsonConnection.InputBomb.PlaceBomb);
-            con.SendEvent(TcpJsonConnection.InputBomb.Idle);
         }
 
         private void Right_Pressed(object sender, EventArgs e)
         {
             con.SendEvent(TcpJsonConnection.InputState.Right);
-            con.SendEvent(TcpJsonConnection.InputState.Idle);
         }
 
         private void Left_Pressed(object sender, EventArgs e)
         {
             con.SendEvent(TcpJsonConnection.InputState.Left);
-            con.SendEvent(TcpJsonConnection.InputState.Idle);
         }
 
         private void Down_Pressed(object sender, EventArgs e)
         {
             con.SendEvent(TcpJsonConnection.InputState.Down);
-            con.SendEvent(TcpJsonConnection.InputState.Idle);
         }
 
 
         private void Up_Pressed(object sender, EventArgs e)
         {
             con.SendEvent(TcpJsonConnection.InputState.Up);
-            con.SendEvent(TcpJsonConnection.InputState.Idle);
         }
     }
 }