From 13533ee367c5ef4ba695aa273609db66c7e0138a Mon Sep 17 00:00:00 2001 From: polten0 Date: Thu, 15 Aug 2024 10:02:50 +0300 Subject: [PATCH 1/7] =?UTF-8?q?=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D0=BB=20MapM?= =?UTF-8?q?anager,=20=D0=BA=D0=BE=D0=B4=D0=B0=20=D0=BD=D0=B5=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GameManagers/MapManager/MapManager.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 ZoFo/GameCore/GameManagers/MapManager/MapManager.cs diff --git a/ZoFo/GameCore/GameManagers/MapManager/MapManager.cs b/ZoFo/GameCore/GameManagers/MapManager/MapManager.cs new file mode 100644 index 0000000..d9325e0 --- /dev/null +++ b/ZoFo/GameCore/GameManagers/MapManager/MapManager.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ZoFo.GameCore.GameManagers.MapManager +{ + public class MapManager + { + public void LoadMap() + { + + } + private void LoadTileSet() + { + + } + + } +} From a24415bab7e01c335b2fd4bedc023f4206f39175 Mon Sep 17 00:00:00 2001 From: polten0 Date: Thu, 15 Aug 2024 10:47:54 +0300 Subject: [PATCH 2/7] =?UTF-8?q?MapElements,=20=D0=BD=D0=B0=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D0=BD=D0=B8=D0=BB=20=D0=B4=D0=BB=D1=8F=20json=20Serializ?= =?UTF-8?q?e/Deserialize?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MapManager/MapElements/Chunk.cs | 17 +++++++++++++++++ .../MapManager/MapElements/Layer.cs | 17 +++++++++++++++++ .../MapManager/MapElements/TileMap.cs | 16 ++++++++++++++++ .../MapManager/MapElements/TileSet.cs | 12 ++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 ZoFo/GameCore/GameManagers/MapManager/MapElements/Chunk.cs create mode 100644 ZoFo/GameCore/GameManagers/MapManager/MapElements/Layer.cs create mode 100644 ZoFo/GameCore/GameManagers/MapManager/MapElements/TileMap.cs create mode 100644 ZoFo/GameCore/GameManagers/MapManager/MapElements/TileSet.cs diff --git a/ZoFo/GameCore/GameManagers/MapManager/MapElements/Chunk.cs b/ZoFo/GameCore/GameManagers/MapManager/MapElements/Chunk.cs new file mode 100644 index 0000000..6337d3c --- /dev/null +++ b/ZoFo/GameCore/GameManagers/MapManager/MapElements/Chunk.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ZoFo.GameCore.GameManagers.MapManager.MapElements +{ + public class Chunk + { + public int[] Data { get; set; } + public int Height { get; set; } + public int Width { get; set; } + public int X { get; set; } + public int Y { get; set; } + } +} diff --git a/ZoFo/GameCore/GameManagers/MapManager/MapElements/Layer.cs b/ZoFo/GameCore/GameManagers/MapManager/MapElements/Layer.cs new file mode 100644 index 0000000..f598efe --- /dev/null +++ b/ZoFo/GameCore/GameManagers/MapManager/MapElements/Layer.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ZoFo.GameCore.GameManagers.MapManager.MapElements +{ + public class Layer + { + public List Chunks { get; set; } + public int Height { get; set; } + public int Width { get; set; } + public int Id { get; set; } + public bool Visibility { get; set; } + } +} diff --git a/ZoFo/GameCore/GameManagers/MapManager/MapElements/TileMap.cs b/ZoFo/GameCore/GameManagers/MapManager/MapElements/TileMap.cs new file mode 100644 index 0000000..4cd2de9 --- /dev/null +++ b/ZoFo/GameCore/GameManagers/MapManager/MapElements/TileMap.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ZoFo.GameCore.GameManagers.MapManager.MapElements +{ + public class TileMap + { + public bool Infinite { get; set; } + public int TileHeight { get; set; } + public int TileWidth { get; set; } + public List TileSets { get; set; } + } +} diff --git a/ZoFo/GameCore/GameManagers/MapManager/MapElements/TileSet.cs b/ZoFo/GameCore/GameManagers/MapManager/MapElements/TileSet.cs new file mode 100644 index 0000000..26b3627 --- /dev/null +++ b/ZoFo/GameCore/GameManagers/MapManager/MapElements/TileSet.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ZoFo.GameCore.GameManagers.MapManager.MapElements +{ + public class TileSet + { + } +} From 45f47d794ee1d1e454dffec7d90d82a4b17e28fe Mon Sep 17 00:00:00 2001 From: MARKPRO44 <119742977+MARKPRO4444@users.noreply.github.com> Date: Thu, 15 Aug 2024 11:30:32 +0300 Subject: [PATCH 3/7] ArchitectureClientNetworkManager --- ZoFo/GameCore/Client.cs | 2 +- .../NetworkManager/ClientNetworkManager.cs | 43 +++++++++++++++++-- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/ZoFo/GameCore/Client.cs b/ZoFo/GameCore/Client.cs index 3716e15..f8a9288 100644 --- a/ZoFo/GameCore/Client.cs +++ b/ZoFo/GameCore/Client.cs @@ -7,7 +7,7 @@ namespace ZoFo.GameCore public void GameEndedUnexpectedly(){ } - public void JoinRoom() { } + public void JoinRoom(){ } public void JoinYourself(){ } } diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs b/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs index 8e77a67..8535760 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs @@ -1,17 +1,52 @@ +using System.Data.SqlTypes; +using System.Net; +using System.Net.Sockets; using System.Security.Cryptography.X509Certificates; +using System.Text; using System.Threading; namespace ZoFo.GameCore.GameManagers.NetworkManager { - public delegate void OnDataSent(string Data); - public class ClientNetworkManager { - public event OnDataSent DataSent; - public static void StartListening() + private IPAddress iPAddress = IPAddress.Any; + private int port = 7632; + private EndPoint endPoint; + private Socket socket; + delegate void OnDataSent(string Data); + + public void Init() //create endPoint, socket + { + endPoint = new IPEndPoint(iPAddress, port); + socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + } + + public void SendData() { } + + public void JoinRoom() + { + StartListening(); + } + + public void JoinYourself() + { + StartListening(); + } + + //поток 2 + public void StartListening() + { + socket.Connect(endPoint); + + byte[] bytes = new byte[2048]; + + var countAnsw = socket.Receive(bytes); + + string message = Encoding.UTF8.GetString(bytes, 0, countAnsw); + } } } \ No newline at end of file From 7d3e4da143c53ba61a517350a0be5dc6970314b8 Mon Sep 17 00:00:00 2001 From: MARKPRO44 <119742977+MARKPRO4444@users.noreply.github.com> Date: Thu, 15 Aug 2024 11:43:09 +0300 Subject: [PATCH 4/7] eventClientNetworkManager --- .../NetworkManager/ClientNetworkManager.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs b/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs index 8535760..033cc30 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/ClientNetworkManager.cs @@ -1,3 +1,4 @@ +using System; using System.Data.SqlTypes; using System.Net; using System.Net.Sockets; @@ -15,7 +16,7 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager private EndPoint endPoint; private Socket socket; delegate void OnDataSent(string Data); - + event OnDataSent GetDataSent; // event public void Init() //create endPoint, socket { endPoint = new IPEndPoint(iPAddress, port); @@ -27,13 +28,15 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager } - public void JoinRoom() + public void JoinRoom() // multyplayer { + SendData(); StartListening(); } - public void JoinYourself() + public void JoinYourself() // single player { + SendData(); StartListening(); } @@ -46,7 +49,7 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager var countAnsw = socket.Receive(bytes); - string message = Encoding.UTF8.GetString(bytes, 0, countAnsw); + string updates = Encoding.UTF8.GetString(bytes, 0, countAnsw); // обновления отосланные сервером } } } \ No newline at end of file From d6daa3d0635b4f0cb7143b615ff4f72cf36dcc91 Mon Sep 17 00:00:00 2001 From: rawer470 Date: Thu, 15 Aug 2024 11:46:01 +0300 Subject: [PATCH 5/7] UpdateListen --- .../NetworkManager/Updates/ClientToServer/UpdateInput.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ClientToServer/UpdateInput.cs b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ClientToServer/UpdateInput.cs index 017ab85..81af1d9 100644 --- a/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ClientToServer/UpdateInput.cs +++ b/ZoFo/GameCore/GameManagers/NetworkManager/Updates/ClientToServer/UpdateInput.cs @@ -6,7 +6,9 @@ using System.Threading.Tasks; namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ClientToServer { - internal class UpdateInput + public class UpdateInput :IUpdateData { + public int IdEntity { get; set; } + public string UpdateType { get; set; } } } From 2d84270589b8d545d082b3ededa8b841320809aa Mon Sep 17 00:00:00 2001 From: Ilya Date: Thu, 15 Aug 2024 13:06:54 +0300 Subject: [PATCH 6/7] Add macos mgcb fix script --- macos-fix-mgcb.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 macos-fix-mgcb.sh diff --git a/macos-fix-mgcb.sh b/macos-fix-mgcb.sh new file mode 100755 index 0000000..a2ec83b --- /dev/null +++ b/macos-fix-mgcb.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +brew install freetype +brew install freeimage +mgcb_ver=$(ls ~/.nuget/packages/dotnet-mgcb/) +mgcb_path=~/.nuget/packages/dotnet-mgcb/$mgcb_ver/tools/net6.0/any/ + +rm $mgcb_path/libfreetype6.dylib $mgcb_path/libFreeImage.dylib + +ln -s /opt/homebrew/lib/libfreetype.dylib $mgcb_path/libfreetype6.dylib +ln -s /opt/homebrew/lib/libfreeimage.dylib $mgcb_path/libFreeImage.dylib From 362c72439fcd7b5c75824844a1b2bd731ca148a7 Mon Sep 17 00:00:00 2001 From: PetrKu09 Date: Thu, 15 Aug 2024 15:09:17 +0300 Subject: [PATCH 7/7] great merge dev and CollisionManager --- .../CollisionManager/CollisionComponent.cs | 49 +++++++++++++++++++ .../CollisionManager/CollisionManager.cs | 33 +++++++++++++ ZoFo/ZoFo.csproj | 3 ++ 3 files changed, 85 insertions(+) create mode 100644 ZoFo/GameCore/GameManagers/CollisionManager/CollisionComponent.cs create mode 100644 ZoFo/GameCore/GameManagers/CollisionManager/CollisionManager.cs diff --git a/ZoFo/GameCore/GameManagers/CollisionManager/CollisionComponent.cs b/ZoFo/GameCore/GameManagers/CollisionManager/CollisionComponent.cs new file mode 100644 index 0000000..7556e1c --- /dev/null +++ b/ZoFo/GameCore/GameManagers/CollisionManager/CollisionComponent.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Reflection.Metadata; +using System.Text; +using System.Threading.Tasks; + +namespace ZoFo.GameCore.GameManagers.CollisionManager +{ + public class CollisionComponent + { + //остановлен ли перс + bool doesStop; + Rectangle stopRectangle; + + // triggers for rectangle + bool isTrigger; + Rectangle triggerRectangle; + + //delegate + public delegate void EventHandler(object sender, EventArgs e); + + + //events + public event EventHandler OnTriggerEnter; + public event EventHandler OnTriggerZone; + public event EventHandler OnTriggerExit; + + // methods-event + public void TriggerEnter(object component, ///, + EventArgs e) + { + + } + public void TriggerZone(object component,///, + EventArgs e) + { + + } + public void TriggerExit(object component,///, + EventArgs e) + { + + } + + + } +} diff --git a/ZoFo/GameCore/GameManagers/CollisionManager/CollisionManager.cs b/ZoFo/GameCore/GameManagers/CollisionManager/CollisionManager.cs new file mode 100644 index 0000000..1c0ab2b --- /dev/null +++ b/ZoFo/GameCore/GameManagers/CollisionManager/CollisionManager.cs @@ -0,0 +1,33 @@ +using Microsoft.VisualBasic; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ZoFo.GameCore.GameManagers.CollisionManager +{ + public class CollisionManager + { + public List CollisionComponent; + public List TriggerComponent; + + public void UpdatePositions() + { + + } + + public void GetObjectInArea(Rectangle area) + { + + } + + public void Register(Rectangle rectangle) + { + + } + + + } +} diff --git a/ZoFo/ZoFo.csproj b/ZoFo/ZoFo.csproj index e29984f..e8147c1 100644 --- a/ZoFo/ZoFo.csproj +++ b/ZoFo/ZoFo.csproj @@ -21,10 +21,13 @@ +<<<<<<< HEAD +======= +>>>>>>> CollisionManager