Removed duplicate Files
authormile4712 <Lehner.Michael43@gmail.com>
Mon, 10 Dec 2018 15:24:02 +0000 (16:24 +0100)
committermile4712 <Lehner.Michael43@gmail.com>
Mon, 10 Dec 2018 15:24:02 +0000 (16:24 +0100)
Referenced removed files from other projects

20 files changed:
src/communication/ConnectionTest/ConnectionTest/ConnectionTest.Android/ConnectionTest.Android.csproj.user
src/communication/ConnectionTest/ConnectionTest/ConnectionTest.Android/MainActivity.cs
src/communication/ConnectionTest/ConnectionTest/ConnectionTest.Android/Properties/AndroidManifest.xml
src/communication/ConnectionTest/ConnectionTest/ConnectionTest.UWP/ConnectionTest.UWP.csproj
src/communication/ConnectionTest/ConnectionTest/ConnectionTest.UWP/MainPage.xaml.cs
src/communication/ConnectionTest/ConnectionTest/ConnectionTest.UWP/Package.appxmanifest
src/communication/ConnectionTest/ConnectionTest/ConnectionTest.iOS/AppDelegate.cs
src/communication/ConnectionTest/ConnectionTest/ConnectionTest/App.xaml
src/communication/ConnectionTest/ConnectionTest/ConnectionTest/App.xaml.cs
src/communication/ConnectionTest/ConnectionTest/ConnectionTest/ConnectionTest.csproj
src/communication/ConnectionTest/ConnectionTest/ConnectionTest/MainPage.xaml
src/communication/ConnectionTest/ConnectionTest/ConnectionTest/MainPage.xaml.cs
src/communication/ConnectionTest/ConnectionTest/ConnectionTest/TcpJsonConnection.cs
src/communication/ConnectionTest/ServerSimulator/Program.cs
src/communication/ConnectionTest/TcpJsonConnectionTest/Program.cs
src/visualization/Playground/HelloMovingImage/HelloMovingImage/AbsoluteLayoutTest.cs
src/visualization/Playground/HelloMovingImage/HelloMovingImage/HelloMovingImage.csproj
src/visualization/Playground/HelloMovingImage/HelloMovingImage/Playground.cs
src/visualization/Playground/HelloMovingImage/HelloMovingImage/PlaygroundPage.cs
src/visualization/Playground/HelloMovingImage/HelloMovingImage/ServerPackage.cs [deleted file]

index 4142abe..d753d69 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
-    <SelectedDevice>Sony D6603</SelectedDevice>
+    <SelectedDevice>Android_Accelerated_x86_Oreo</SelectedDevice>
     <DefaultDevice>Android_Accelerated_x86_Oreo</DefaultDevice>
   </PropertyGroup>
 </Project>
\ No newline at end of file
index 219f102..791bb28 100644 (file)
@@ -1,5 +1,11 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.ConnectionTest">
-    <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="27" />
-    <application android:label="ConnectionTest.Android"></application>
-</manifest>
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.ConnectionTest" android:installLocation="auto">
+       <uses-sdk android:minSdkVersion="20" android:targetSdkVersion="27" />
+       <uses-permission android:name="android.permission.INTERNET" />
+       <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+       <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
+       <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+       <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
+       <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
+       <application android:label="ConnectionTest.Android"></application>
+</manifest>
\ No newline at end of file
index b319528..d5802d8 100644 (file)
     <FileAlignment>512</FileAlignment>
     <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
     <PackageCertificateKeyFile>ConnectionTest.UWP_TemporaryKey.pfx</PackageCertificateKeyFile>
+    <GenerateAppInstallerFile>False</GenerateAppInstallerFile>
+    <AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
+    <AppxBundle>Always</AppxBundle>
+    <AppxBundlePlatforms>x86|x64|arm</AppxBundlePlatforms>
+    <PackageCertificateThumbprint>B488641D238096E70E16111DE2F59FA0AFBEC1E4</PackageCertificateThumbprint>
+    <AppInstallerUpdateFrequency>1</AppInstallerUpdateFrequency>
+    <AppInstallerCheckForUpdateFrequency>OnApplicationRun</AppInstallerCheckForUpdateFrequency>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
     <DebugSymbols>true</DebugSymbols>
index 2ab90b8..98047de 100644 (file)
@@ -12,6 +12,7 @@ using Windows.UI.Xaml.Data;
 using Windows.UI.Xaml.Input;
 using Windows.UI.Xaml.Media;
 using Windows.UI.Xaml.Navigation;
+using Bomberman;
 
 namespace ConnectionTest.UWP
 {
@@ -21,7 +22,7 @@ namespace ConnectionTest.UWP
         {
             this.InitializeComponent();
 
-            LoadApplication(new ConnectionTest.App());
+            LoadApplication(new Bomberman.App());
         }
     }
 }
index dc2cd40..af45c8b 100644 (file)
@@ -1,42 +1,21 @@
 <?xml version="1.0" encoding="utf-8"?>
-
-<Package
-  xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
-  xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
-  xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
-  IgnorableNamespaces="uap mp">
-
-  <Identity
-    Name="86f72843-d865-4b0a-b4e8-0e0eab64a758"
-    Publisher="CN=0a82030a-6916-4e4d-846d-e88d76b918b5"
-    Version="1.0.0.0" />
-
-  <mp:PhoneIdentity PhoneProductId="ec0cc741-fd3e-485c-81be-68815c480690" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
-
+<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
+  <Identity Name="86f72843-d865-4b0a-b4e8-0e0eab64a758" Publisher="CN=0a82030a-6916-4e4d-846d-e88d76b918b5" Version="1.0.4.0" />
+  <mp:PhoneIdentity PhoneProductId="ec0cc741-fd3e-485c-81be-68815c480690" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
   <Properties>
     <DisplayName>ConnectionTest.UWP</DisplayName>
     <PublisherDisplayName>0a82030a-6916-4e4d-846d-e88d76b918b5</PublisherDisplayName>
     <Logo>Assets\StoreLogo.png</Logo>
   </Properties>
-
   <Dependencies>
     <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
   </Dependencies>
-
   <Resources>
-    <Resource Language="x-generate"/>
+    <Resource Language="x-generate" />
   </Resources>
-
   <Applications>
-    <Application Id="App"
-      Executable="$targetnametoken$.exe"
-      EntryPoint="ConnectionTest.UWP.App">
-      <uap:VisualElements
-        DisplayName="ConnectionTest.UWP"
-        Square150x150Logo="Assets\Square150x150Logo.png"
-        Square44x44Logo="Assets\Square44x44Logo.png"
-        Description="ConnectionTest.UWP"
-        BackgroundColor="transparent">
+    <Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="ConnectionTest.UWP.App">
+      <uap:VisualElements DisplayName="ConnectionTest.UWP" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="ConnectionTest.UWP" BackgroundColor="transparent">
         <uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square310x310Logo="Assets\LargeTile.png" Square71x71Logo="Assets\SmallTile.png">
           <uap:ShowNameOnTiles>
             <uap:ShowOn Tile="square150x150Logo" />
@@ -48,7 +27,6 @@
       </uap:VisualElements>
     </Application>
   </Applications>
-
   <Capabilities>
     <Capability Name="internetClient" />
   </Capabilities>
index 8fedee8..b62b976 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" ?>
 <Application xmlns="http://xamarin.com/schemas/2014/forms"
              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
-             x:Class="ConnectionTest.App">
+             x:Class="Bomberman.App">
     <Application.Resources>
 
     </Application.Resources>
index 86900fc..1ca4148 100644 (file)
@@ -3,7 +3,7 @@ using Xamarin.Forms;
 using Xamarin.Forms.Xaml;
 
 [assembly: XamlCompilation(XamlCompilationOptions.Compile)]
-namespace ConnectionTest
+namespace Bomberman
 {
     public partial class App : Application
     {
index a42ab65..0aa5dd9 100644 (file)
   </PropertyGroup>
 
   <ItemGroup>
+    <Compile Include="..\..\..\..\visualization\Playground\HelloMovingImage\HelloMovingImage\Playground.cs" Link="Playground.cs" />
+  </ItemGroup>
+
+  <ItemGroup>
     <PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
     <PackageReference Include="Xamarin.Forms" Version="3.3.0.912540" />
   </ItemGroup>
index 015aeee..9a6df8e 100644 (file)
@@ -2,6 +2,6 @@
 <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
              xmlns:local="clr-namespace:ConnectionTest"
-             x:Class="ConnectionTest.MainPage">
+             x:Class="Bomberman.MainPage">
 
 </ContentPage>
index a2eb64a..da8535c 100644 (file)
@@ -6,29 +6,44 @@ using System.Threading.Tasks;
 using Xamarin.Forms;
 using Newtonsoft.Json;
 using System.Net;
+using static Bomberman.TcpJsonConnection;
 
-namespace ConnectionTest
+namespace Bomberman
 {
     public partial class MainPage : ContentPage
     {
 
+        const int c_defaultPlaygroundSize = 13;
 
         TcpJsonConnection con;
 
+        StackLayout fullLayout;
+        StackLayout ButtonLayout = new StackLayout();
+
+
+        BombermanPlayground.Playground playground;
+
         public MainPage()
         {
             InitializeComponent();
 
-            con = new TcpJsonConnection((field) => { });
+            SizeChanged += MainPage_SizeChanged;
+
+            con = new TcpJsonConnection(ServerPkgReceived);
+
+            //con.Connect(IPAddress.Parse("fe80::6520:ac61:a4a1:827a%20"));
+            con.Connect(Dns.GetHostEntry(Dns.GetHostName()).AddressList[1]);    //localhost
+
+        }
+
+        private void MainPage_SizeChanged(object sender, EventArgs e)
+        {
 
-            //con.Connect(IPAddress.Parse("fe80::c0a:44f1:63e7:bfb8%4"));
-            con.Connect(Dns.GetHostEntry(Dns.GetHostName()).AddressList[0]);    //localhost
 
 
-            StackLayout verticalLayout = new StackLayout();
 
             Entry ent = new Entry();
-            verticalLayout.Children.Add(ent);
+            ButtonLayout.Children.Add(ent);
             ent.TextChanged += Ent_TextChanged;
 
 
@@ -36,16 +51,17 @@ namespace ConnectionTest
             {
                 StackLayout horizontalLayout = new StackLayout();
                 horizontalLayout.Orientation = StackOrientation.Horizontal;
-                verticalLayout.Children.Add(horizontalLayout);
+                ButtonLayout.Children.Add(horizontalLayout);
 
                 Button dummy = new Button();
                 dummy.BackgroundColor = new Color(0xffffffff, 0xffffffff, 0xffffffff);
                 dummy.TextColor = new Color(0xffffffff, 0xffffffff, 0xffffffff);
 
                 dummy.Text = "<";
-                
 
-                switch (i) {
+
+                switch (i)
+                {
                     case 0:
                         horizontalLayout.Children.Add(dummy);
                         Button up = new Button();
@@ -68,7 +84,7 @@ namespace ConnectionTest
 
                         Button right = new Button();
                         right.Pressed += Right_Pressed;
-                        right.Text = ">";                    
+                        right.Text = ">";
                         horizontalLayout.Children.Add(right);
                         break;
 
@@ -84,16 +100,41 @@ namespace ConnectionTest
 
                 }
 
-
+                CreateInitializePlayground(c_defaultPlaygroundSize);
 
 
             }
 
-            Content = verticalLayout;
-            
 
         }
 
+        void CreateInitializePlayground(int size)
+        {
+            fullLayout = new StackLayout();
+            playground = new BombermanPlayground.Playground(size);
+            BombermanPlayground.BombermanBlock.BlockSize = Width / (size + 1);
+
+
+            fullLayout.Children.Add(playground);
+            fullLayout.Children.Add(ButtonLayout);
+            Content = fullLayout;
+
+        }
+
+        void ServerPkgReceived(ServerPackage pkg)
+        {
+            Device.BeginInvokeOnMainThread(() =>
+            {
+                if (playground.FieldSize != pkg.Field.Count)
+                {
+                    CreateInitializePlayground(pkg.Field.Count);
+                }
+                playground.Update(pkg);
+
+            });
+        }
+
+
         private void Ent_TextChanged(object sender, TextChangedEventArgs e)
         {
             switch(((Entry)sender).Text)
index 7a724e2..ef5fabd 100644 (file)
@@ -5,12 +5,11 @@ using System.Net;
 using System.Net.Sockets;
 using System.Text;
 using System.Threading.Tasks;
-using ConnectionTest;
 using Newtonsoft.Json;
 
 
 
-namespace ServerSimulator
+namespace Bomberman
 {
 
 
index 0b1bbbb..413f9d5 100644 (file)
@@ -5,9 +5,8 @@ using System.Net;
 using System.Net.Sockets;
 using System.Text;
 using System.Threading.Tasks;
-using ConnectionTest;
 
-namespace TcpJsonConnectionTest
+namespace Bomberman
 {
     class Program
     {
index ad91ca7..2235467 100644 (file)
@@ -8,6 +8,7 @@ using Xamarin.Forms;
 using Newtonsoft.Json;
 
 using Bomberman;
+using static Bomberman.TcpJsonConnection;
 
 namespace HelloMovingImage
 {
@@ -34,10 +35,6 @@ namespace HelloMovingImage
             PopulateMap();
         }
 
-        public void PopulateMap(ServerPackage pkg)
-        {
-
-        }
 
 
 
index df3f1c2..f4bd3af 100644 (file)
   </ItemGroup>
 
   <ItemGroup>
+    <Compile Include="..\..\..\..\communication\ConnectionTest\ConnectionTest\ConnectionTest\TcpJsonConnection.cs" Link="TcpJsonConnection.cs" />
+  </ItemGroup>
+
+  <ItemGroup>
     <EmbeddedResource Include="Images\Player4.png" />
     <EmbeddedResource Include="Images\Player3.png" />
     <EmbeddedResource Include="Images\Player2.png" />
index 93d0304..2bdc35d 100644 (file)
@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.Text;
 using Bomberman;
 using Xamarin.Forms;
+using static Bomberman.TcpJsonConnection;
 
 namespace BombermanPlayground
 {
index bc7f3ba..c921ed9 100644 (file)
@@ -1,8 +1,8 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
-using System.Text;
-using Bomberman;
+using static Bomberman.TcpJsonConnection;
+
 
 using Xamarin.Forms;
 
@@ -36,7 +36,7 @@ namespace BombermanPlayground
 
         }
 
-        public ServerPackage CreateServerPackage()
+        private ServerPackage CreateServerPackage()
         {
             const int FieldSize = c_SimulationFieldSize;
             const int ClientId = 0;
diff --git a/src/visualization/Playground/HelloMovingImage/HelloMovingImage/ServerPackage.cs b/src/visualization/Playground/HelloMovingImage/HelloMovingImage/ServerPackage.cs
deleted file mode 100644 (file)
index f75ecc9..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Newtonsoft.Json;
-
-namespace Bomberman
-{
-    public class ServerPackage
-    {
-        public ServerPackage()
-        {
-            Field = new List<List<FieldTypes>>();
-            Players = new List<Player>();
-            Bombs = new List<Bomb>();
-            Flames = new List<Flame>();
-        }
-
-        [JsonProperty("id")]
-        public int Id { get; set; }
-
-        [JsonProperty("state")]
-        public ServerState State { get; set; }
-        public enum ServerState
-        {
-            PreGamePhase = 0,
-            InGamePhase = 1,
-            PostGamePhase = 2,
-        }
-
-        [JsonProperty("timeout")]
-        public int Timeout { get; set; }
-
-        [JsonProperty("field")]
-        public List<List<FieldTypes>> Field { get; set; }
-        public enum FieldTypes
-        {
-            EmptyField = 0,
-            StaticOrUndestroyableBlock = 1,
-            DynamicOrDestroyableBlock = 2,
-            ItemOrMoreBombs = 3,
-        }
-
-        [JsonProperty("players")]
-        public List<Player> Players { get; set; }
-        public class Player
-        {
-            [JsonProperty("id")]
-            public int Id { get; set; }
-
-            [JsonProperty("x")]
-            public double X { get; set; }
-
-            [JsonProperty("y")]
-            public double Y { get; set; }
-
-            [JsonProperty("live")]
-            public int Life { get; set; }
-        }
-
-        [JsonProperty("bombs")]
-        public List<Bomb> Bombs { get; set; }
-        public class Bomb
-        {
-            [JsonProperty("id")]
-            public int Id { get; set; }
-
-            [JsonProperty("x")]
-            public double X { get; set; }
-
-            [JsonProperty("y")]
-            public double Y { get; set; }
-
-            [JsonProperty("timeout")]
-            public int Timeout { get; set; }
-        }
-
-        [JsonProperty("flames")]
-        public List<Flame> Flames { get; set; }
-        public class Flame
-        {
-            [JsonProperty("id")]
-            public int Id { get; set; }
-
-            [JsonProperty("x")]
-            public double X { get; set; }
-
-            [JsonProperty("y")]
-            public double Y { get; set; }
-
-            [JsonProperty("timeout")]
-            public int Timeout { get; set; }
-        }
-    }
-}