From 9907aebe36247d9fa175466c60c5416a325173ad Mon Sep 17 00:00:00 2001 From: Syntriax Date: Tue, 5 Aug 2025 14:42:26 +0300 Subject: [PATCH] initial commit --- .dockerignore | 484 ++++++++++++++++++++ .gitignore | 484 ++++++++++++++++++++ .gitmodules | 3 + .vscode/launch.json | 80 ++++ .vscode/tasks.json | 33 ++ Dockerfile | 16 + Engine | 1 + Platforms/Desktop/.config/dotnet-tools.json | 36 ++ Platforms/Desktop/Desktop.csproj | 91 ++++ Platforms/Desktop/Icon.bmp | Bin 0 -> 196746 bytes Platforms/Desktop/Icon.ico | Bin 0 -> 7369 bytes Platforms/Desktop/Icon.png | Bin 0 -> 7411 bytes Platforms/Desktop/Program.cs | 44 ++ Platforms/Desktop/app.manifest | 43 ++ Platforms/Desktop/icon.svg | 131 ++++++ Platforms/Server/Endpoints.cs | 40 ++ Platforms/Server/Program.cs | 35 ++ Platforms/Server/Server.csproj | 23 + Project.sln | 177 +++++++ README.md | 79 ++++ Shared/.config/dotnet-tools.json | 36 ++ Shared/Behaviours/ExampleBehaviour.cs | 27 ++ Shared/Behaviours/IRotator.cs | 5 + Shared/Behaviours/LinearRotator.cs | 13 + Shared/Behaviours/RotatorToggler.cs | 31 ++ Shared/Behaviours/TweenRotator.cs | 35 ++ Shared/Content/Content.mgcb | 15 + Shared/Shared.csproj | 17 + Shared/UniverseSource.cs | 61 +++ 29 files changed, 2040 insertions(+) create mode 100644 .dockerignore create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json create mode 100644 Dockerfile create mode 160000 Engine create mode 100644 Platforms/Desktop/.config/dotnet-tools.json create mode 100644 Platforms/Desktop/Desktop.csproj create mode 100644 Platforms/Desktop/Icon.bmp create mode 100644 Platforms/Desktop/Icon.ico create mode 100644 Platforms/Desktop/Icon.png create mode 100644 Platforms/Desktop/Program.cs create mode 100644 Platforms/Desktop/app.manifest create mode 100644 Platforms/Desktop/icon.svg create mode 100644 Platforms/Server/Endpoints.cs create mode 100644 Platforms/Server/Program.cs create mode 100644 Platforms/Server/Server.csproj create mode 100644 Project.sln create mode 100644 README.md create mode 100644 Shared/.config/dotnet-tools.json create mode 100644 Shared/Behaviours/ExampleBehaviour.cs create mode 100644 Shared/Behaviours/IRotator.cs create mode 100644 Shared/Behaviours/LinearRotator.cs create mode 100644 Shared/Behaviours/RotatorToggler.cs create mode 100644 Shared/Behaviours/TweenRotator.cs create mode 100644 Shared/Content/Content.mgcb create mode 100644 Shared/Shared.csproj create mode 100644 Shared/UniverseSource.cs diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..104b544 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,484 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from `dotnet new gitignore` + +# dotenv files +.env + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET +project.lock.json +project.fragment.lock.json +artifacts/ + +# Tye +.tye/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml +.idea + +## +## Visual studio for Mac +## + + +# globs +Makefile.in +*.userprefs +*.usertasks +config.make +config.status +aclocal.m4 +install-sh +autom4te.cache/ +*.tar.gz +tarballs/ +test-results/ + +# Mac bundle stuff +*.dmg +*.app + +# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# Vim temporary swap files +*.swp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5e57f18 --- /dev/null +++ b/.gitignore @@ -0,0 +1,484 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from `dotnet new gitignore` + +# dotenv files +.env + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET +project.lock.json +project.fragment.lock.json +artifacts/ + +# Tye +.tye/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml +.idea + +## +## Visual studio for Mac +## + + +# globs +Makefile.in +*.userprefs +*.usertasks +config.make +config.status +aclocal.m4 +install-sh +autom4te.cache/ +*.tar.gz +tarballs/ +test-results/ + +# Mac bundle stuff +*.dmg +*.app + +# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# Vim temporary swap files +*.swp diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e8a1898 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Engine"] + path = Engine + url = git@git.syntriax.com:Syntriax/Syntriax.Engine.git diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..0780f96 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,80 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": ".NET Launch (Client) 1", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build-client", + "program": "${workspaceFolder}/Platforms/Desktop/bin/Debug/net9.0/MyUniverse.dll", + "args": [], + "cwd": "${workspaceFolder}", + "stopAtEntry": false, + "console": "internalConsole", + "justMyCode": false, + "logging": { + "moduleLoad": false, + "programOutput": true + } + }, + { + "name": ".NET Launch (Client) 2", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build-client", + "program": "${workspaceFolder}/Platforms/Desktop/bin/Debug/net9.0/MyUniverse.dll", + "args": [], + "cwd": "${workspaceFolder}", + "stopAtEntry": false, + "console": "internalConsole", + "justMyCode": false, + "logging": { + "moduleLoad": false, + "programOutput": true + } + }, + { + "name": ".NET Launch (Server)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build-server", + "program": "${workspaceFolder}/Platforms/Server/bin/Debug/net9.0/Server.dll", + "args": [], + "env": { + "PORT": "8888", + }, + "cwd": "${workspaceFolder}", + "stopAtEntry": false, + "console": "internalConsole", + "justMyCode": false, + "logging": { + "moduleLoad": false, + "programOutput": true + } + } + ], + "compounds": [ + { + "name": ".NET Launch Client & Server", + "configurations": [ + ".NET Launch (Server)", + ".NET Launch (Client) 1" + ] + }, + { + "name": ".NET Launch 2 Client & 1 Server", + "configurations": [ + ".NET Launch (Server)", + ".NET Launch (Client) 1", + ".NET Launch (Client) 2" + ] + }, + { + "name": ".NET Launch 2 Clients", + "configurations": [ + ".NET Launch (Client) 1", + ".NET Launch (Client) 2" + ] + } + ] +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..85504ad --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,33 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build-client", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/Platforms/Desktop" + ], + "problemMatcher": "$msCompile", + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "label": "build-server", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/Platforms/Server" + ], + "problemMatcher": "$msCompile", + "group": { + "kind": "build", + "isDefault": true + } + } + ] +} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fc413f1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build + +WORKDIR /App +COPY . ./ + +RUN dotnet restore +RUN dotnet publish Platforms/Server -c Release -r linux-musl-x64 --self-contained true -o out + +FROM alpine:latest + +WORKDIR /App +COPY --from=build /App/out . + +RUN apk add --no-cache icu-libs + +ENTRYPOINT ["./Server"] diff --git a/Engine b/Engine new file mode 160000 index 0000000..d78c42a --- /dev/null +++ b/Engine @@ -0,0 +1 @@ +Subproject commit d78c42a65327a5889636da1a8d99e57513e20098 diff --git a/Platforms/Desktop/.config/dotnet-tools.json b/Platforms/Desktop/.config/dotnet-tools.json new file mode 100644 index 0000000..84ff03d --- /dev/null +++ b/Platforms/Desktop/.config/dotnet-tools.json @@ -0,0 +1,36 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "dotnet-mgcb": { + "version": "3.8.2.1105", + "commands": [ + "mgcb" + ] + }, + "dotnet-mgcb-editor": { + "version": "3.8.2.1105", + "commands": [ + "mgcb-editor" + ] + }, + "dotnet-mgcb-editor-linux": { + "version": "3.8.2.1105", + "commands": [ + "mgcb-editor-linux" + ] + }, + "dotnet-mgcb-editor-windows": { + "version": "3.8.2.1105", + "commands": [ + "mgcb-editor-windows" + ] + }, + "dotnet-mgcb-editor-mac": { + "version": "3.8.2.1105", + "commands": [ + "mgcb-editor-mac" + ] + } + } +} \ No newline at end of file diff --git a/Platforms/Desktop/Desktop.csproj b/Platforms/Desktop/Desktop.csproj new file mode 100644 index 0000000..ba4e7ad --- /dev/null +++ b/Platforms/Desktop/Desktop.csproj @@ -0,0 +1,91 @@ + + + WinExe + net9.0 + Major + false + false + enable + MyUniverse.Platforms.Desktop + MyUniverse + + + app.manifest + Icon.ico + + + + + + + + Icon.ico + + + Icon.bmp + + + + + + + + + + + + + + + Content/Content.mgcb + + + + + + + + + + + + + False + + ../Libraries + ./Libraries + + + SDL2.dll + + hostfxr;hostpolicy;*.deps.json;*.runtimeconfig*.json + + False + + False + + False + + auto + + False + + + + True + + + + + + + + + + + Info + + + + + diff --git a/Platforms/Desktop/Icon.bmp b/Platforms/Desktop/Icon.bmp new file mode 100644 index 0000000000000000000000000000000000000000..f57550d2b750214da7df5ed0743af91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/Icon.png b/Platforms/Desktop/Icon.png new file mode 100644 index 0000000000000000000000000000000000000000..d883939982eccde3c128e00afa106affdf37c782 GIT binary patch literal 7411 zcmXXLcRbYZ|8r-Pm6?5KXN9b@Iay^3WhZ;DL&h0d373TIvXfa6LP>Waima@&_aDl3PZJ7zH@5n^FrnFdTZ(W5 zg6%Fncj3LycJjG;!kQ#`LHTq+Bu3P9=75zh@Q}X$Q9+#c2F{9e3*ri!I?4d7?u=H|xNX1a;xukfI03=)M@i&CFk*k#etMYZ2w zI+idl?y)=Nq#!k72Z%3DHZcYe_J(xUsGT~}YZ8ygUMVcxO^6yv#o=(GS~*kjwpDWb z?S9R}(mN`Ar5o3I5D=la2nKre72uLVBOI3JsEK@XB3wnpl!awc)6nqu%4HyWOm|+2 z6d4XpOrCWiul9Gh{PoVw_2t?Ptz8^co*OkCS-q9BWgw5GOeFI=Y|F<@$n(@0>+Syi z{Cnr{*DnQ{;b`wAW0Lge&&@`17LO8%%czP{*OZV5JxHAp*{c4lSFfbZ6F&CyQu4rH zZ`-DFWNe^AogxQLUTy%hb-(zb!NiC6Qf3MDj}sC^CPMuE8!mU>HKw@_)>Eok0Fa(9 zbUCk;&@~sb*zBRGyv&@BS*Yg{cGH#DQyK!+zY;X_8zejwA(Gr`TILFgj1(9sm3ZFw z+qcgS@kCV`*(x;lmo?|ZoOM4~pqkN2O>0Tv>1bE-q&ts-Ijy(f@s4b?l9uH|zjk+1 zXupVPVE9u`=SsD8hK!;?!g&6vO;|=lG@%!!=F7@+JglZ`O0w}>2M({&BgQ$b zE}Kx=dUup9s_sKJra~*)3mH{`#6gdIUQw9!N^0qfL7pHq;8c%z#myiMU^HOyoH3qY>2~g=)&goO>3)o6D5zN zWPRSyQWHc?85K*1(O+98pC}^`ep7B$mwW};;^yY@CmM-fK11q}7gcimkAB5svk3R! z@n1(bH_Q8Ns;JifWvC2lQjK|m?e5N8X_et;qsY!(mD2|@^c&RSgEkpGi*IbJO+L+~ z)kOYWz?VKypNhvy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.BehaviourController.AddBehaviour(); + +universe.InstantiateUniverseObject().SetUniverseObject("Visual Managers") + .BehaviourController.AddBehaviour() + .BehaviourController.AddBehaviour(); + +/* For Networking +LiteNetLibClient client = universe.InstantiateUniverseObject().SetUniverseObject("Client").BehaviourController.AddBehaviour(); +client.BehaviourController.AddBehaviour(); +universe.OnPreUpdate.AddOneTimeListener((_, _) => client.Connect("localhost", 8888)); +*/ + +MyUniverse.Shared.UniverseSource.ApplyUniverse(universe); + +using MonoGameWindow monoGameWindow = new(universe); + +monoGameWindow.Graphics.GraphicsProfile = GraphicsProfile.HiDef; + +monoGameWindow.Run(); diff --git a/Platforms/Desktop/app.manifest b/Platforms/Desktop/app.manifest new file mode 100644 index 0000000..ede0b4e --- /dev/null +++ b/Platforms/Desktop/app.manifest @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true/pm + permonitorv2,permonitor + + + + diff --git a/Platforms/Desktop/icon.svg b/Platforms/Desktop/icon.svg new file mode 100644 index 0000000..4d69e30 --- /dev/null +++ b/Platforms/Desktop/icon.svg @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + diff --git a/Platforms/Server/Endpoints.cs b/Platforms/Server/Endpoints.cs new file mode 100644 index 0000000..d51a259 --- /dev/null +++ b/Platforms/Server/Endpoints.cs @@ -0,0 +1,40 @@ + +using System; +using System.Threading.Tasks; + +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.DependencyInjection; + +using Engine.Core; +using Engine.Systems.Network; + +namespace Server; + +public class Endpoints : Behaviour, IFirstFrameUpdate +{ + private INetworkCommunicatorServer? server = null!; + + public Endpoints() + { + Task.Run(() => + { + WebApplicationBuilder builder = WebApplication.CreateBuilder(); + + builder.Services.AddHealthChecks(); + + WebApplication app = builder.Build(); + + app.MapHealthChecks("/health"); + + app.MapGet("/stats", GetStats); + + app.Run($"http://0.0.0.0:{Environment.GetEnvironmentVariable("PORT") ?? "8888"}"); + }); + } + + private IResult GetStats() => Results.Json(new { Count = server?.Connections.Count ?? 0 }); + + public void FirstActiveFrame() => server = Universe.FindRequiredBehaviour(); + protected override void OnExitedUniverse(IUniverse universe) => server = null; +} diff --git a/Platforms/Server/Program.cs b/Platforms/Server/Program.cs new file mode 100644 index 0000000..78119b8 --- /dev/null +++ b/Platforms/Server/Program.cs @@ -0,0 +1,35 @@ +using System; +using System.Threading; + +using Engine.Core; +using Engine.Core.Debug; +using Engine.Systems.Network; + +Universe universe = new(); + +FileLogger fileLogger = new($"Logs/{DateTime.UtcNow:yyyy-MM-dd_HH-mm-ss-ffffff}.log"); +universe.InstantiateUniverseObject().SetUniverseObject("Logger").BehaviourController + .AddBehaviour().Logger = ILogger.Shared = new LoggerWrapper(fileLogger, new ConsoleLogger()); + +LiteNetLibServer server = universe.InstantiateUniverseObject().SetUniverseObject("Server").BehaviourController.AddBehaviour(); +server.BehaviourController.AddBehaviour(); +universe.OnPreUpdate.AddOneTimeListener((_, _) => server.Start(8888, 2)); + +MyUniverse.Shared.UniverseSource.ApplyUniverse(universe); + +DateTime lastRun = DateTime.UtcNow; +TimeSpan interval = new(0, 0, 0, 0, 16); +TimeSpan timeSinceStart = new(0); + +universe.Initialize(); + +while (true) +{ + if (lastRun + interval <= DateTime.UtcNow) + { + lastRun += interval; + timeSinceStart += interval; + universe.Update(new(timeSinceStart, interval)); + } + Thread.Sleep(1); +} diff --git a/Platforms/Server/Server.csproj b/Platforms/Server/Server.csproj new file mode 100644 index 0000000..f527caa --- /dev/null +++ b/Platforms/Server/Server.csproj @@ -0,0 +1,23 @@ + + + + Exe + net9.0 + disable + enable + MyUniverse.Platforms.Server + MyUniverse + + + + + + + + + + + + + + diff --git a/Project.sln b/Project.sln new file mode 100644 index 0000000..ed57f5b --- /dev/null +++ b/Project.sln @@ -0,0 +1,177 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Engine", "Engine", "{F7F62670-237A-4C93-A30E-CE661C6FC401}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Engine.Core", "Engine\Engine.Core\Engine.Core.csproj", "{990CA10C-1EBB-4395-A43A-456B7029D8C9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Engine.Physics2D", "Engine\Engine.Physics2D\Engine.Physics2D.csproj", "{0D97F83C-B043-48B1-B155-7354C4E84FC0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Engine", "Engine\Engine\Engine.csproj", "{2F6B1E26-1217-4EFD-874C-05ADEE4C7969}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shared", "Shared\Shared.csproj", "{590E392E-9FB3-49FA-B4DA-6C8F7126FFE5}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Platforms", "Platforms", "{FECFFD54-338F-4060-9161-1E5770D1DC33}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Desktop", "Platforms\Desktop\Desktop.csproj", "{2B627F66-5A61-4F69-B479-62EEAB603D01}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Engine.Systems", "Engine\Engine.Systems\Engine.Systems.csproj", "{8863A1BA-2E83-419F-BACB-D4A4156EC71C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Engine.Integration", "Engine.Integration", "{9059393F-4073-9273-0EEC-2B1BA61B620B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Engine.Integration.MonoGame", "Engine\Engine.Integration\Engine.Integration.MonoGame\Engine.Integration.MonoGame.csproj", "{7CC31BC4-38EE-40F4-BBBA-9FC2F4CF6283}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server", "Platforms\Server\Server.csproj", "{A15263DB-DF65-4A07-8CA1-33A2919501A0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Engine.Integration.Yaml", "Engine\Engine.Integration\Engine.Integration.Yaml\Engine.Integration.Yaml.csproj", "{79F870AB-249E-4CA0-9DF0-F265514581DF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Engine.Integration.LiteNetLib", "Engine\Engine.Integration\Engine.Integration.LiteNetLib\Engine.Integration.LiteNetLib.csproj", "{7AA22306-772F-45F4-8F30-97EBD1FC124D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {990CA10C-1EBB-4395-A43A-456B7029D8C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {990CA10C-1EBB-4395-A43A-456B7029D8C9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {990CA10C-1EBB-4395-A43A-456B7029D8C9}.Debug|x64.ActiveCfg = Debug|Any CPU + {990CA10C-1EBB-4395-A43A-456B7029D8C9}.Debug|x64.Build.0 = Debug|Any CPU + {990CA10C-1EBB-4395-A43A-456B7029D8C9}.Debug|x86.ActiveCfg = Debug|Any CPU + {990CA10C-1EBB-4395-A43A-456B7029D8C9}.Debug|x86.Build.0 = Debug|Any CPU + {990CA10C-1EBB-4395-A43A-456B7029D8C9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {990CA10C-1EBB-4395-A43A-456B7029D8C9}.Release|Any CPU.Build.0 = Release|Any CPU + {990CA10C-1EBB-4395-A43A-456B7029D8C9}.Release|x64.ActiveCfg = Release|Any CPU + {990CA10C-1EBB-4395-A43A-456B7029D8C9}.Release|x64.Build.0 = Release|Any CPU + {990CA10C-1EBB-4395-A43A-456B7029D8C9}.Release|x86.ActiveCfg = Release|Any CPU + {990CA10C-1EBB-4395-A43A-456B7029D8C9}.Release|x86.Build.0 = Release|Any CPU + {0D97F83C-B043-48B1-B155-7354C4E84FC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0D97F83C-B043-48B1-B155-7354C4E84FC0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0D97F83C-B043-48B1-B155-7354C4E84FC0}.Debug|x64.ActiveCfg = Debug|Any CPU + {0D97F83C-B043-48B1-B155-7354C4E84FC0}.Debug|x64.Build.0 = Debug|Any CPU + {0D97F83C-B043-48B1-B155-7354C4E84FC0}.Debug|x86.ActiveCfg = Debug|Any CPU + {0D97F83C-B043-48B1-B155-7354C4E84FC0}.Debug|x86.Build.0 = Debug|Any CPU + {0D97F83C-B043-48B1-B155-7354C4E84FC0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0D97F83C-B043-48B1-B155-7354C4E84FC0}.Release|Any CPU.Build.0 = Release|Any CPU + {0D97F83C-B043-48B1-B155-7354C4E84FC0}.Release|x64.ActiveCfg = Release|Any CPU + {0D97F83C-B043-48B1-B155-7354C4E84FC0}.Release|x64.Build.0 = Release|Any CPU + {0D97F83C-B043-48B1-B155-7354C4E84FC0}.Release|x86.ActiveCfg = Release|Any CPU + {0D97F83C-B043-48B1-B155-7354C4E84FC0}.Release|x86.Build.0 = Release|Any CPU + {2F6B1E26-1217-4EFD-874C-05ADEE4C7969}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2F6B1E26-1217-4EFD-874C-05ADEE4C7969}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2F6B1E26-1217-4EFD-874C-05ADEE4C7969}.Debug|x64.ActiveCfg = Debug|Any CPU + {2F6B1E26-1217-4EFD-874C-05ADEE4C7969}.Debug|x64.Build.0 = Debug|Any CPU + {2F6B1E26-1217-4EFD-874C-05ADEE4C7969}.Debug|x86.ActiveCfg = Debug|Any CPU + {2F6B1E26-1217-4EFD-874C-05ADEE4C7969}.Debug|x86.Build.0 = Debug|Any CPU + {2F6B1E26-1217-4EFD-874C-05ADEE4C7969}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2F6B1E26-1217-4EFD-874C-05ADEE4C7969}.Release|Any CPU.Build.0 = Release|Any CPU + {2F6B1E26-1217-4EFD-874C-05ADEE4C7969}.Release|x64.ActiveCfg = Release|Any CPU + {2F6B1E26-1217-4EFD-874C-05ADEE4C7969}.Release|x64.Build.0 = Release|Any CPU + {2F6B1E26-1217-4EFD-874C-05ADEE4C7969}.Release|x86.ActiveCfg = Release|Any CPU + {2F6B1E26-1217-4EFD-874C-05ADEE4C7969}.Release|x86.Build.0 = Release|Any CPU + {590E392E-9FB3-49FA-B4DA-6C8F7126FFE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {590E392E-9FB3-49FA-B4DA-6C8F7126FFE5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {590E392E-9FB3-49FA-B4DA-6C8F7126FFE5}.Debug|x64.ActiveCfg = Debug|Any CPU + {590E392E-9FB3-49FA-B4DA-6C8F7126FFE5}.Debug|x64.Build.0 = Debug|Any CPU + {590E392E-9FB3-49FA-B4DA-6C8F7126FFE5}.Debug|x86.ActiveCfg = Debug|Any CPU + {590E392E-9FB3-49FA-B4DA-6C8F7126FFE5}.Debug|x86.Build.0 = Debug|Any CPU + {590E392E-9FB3-49FA-B4DA-6C8F7126FFE5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {590E392E-9FB3-49FA-B4DA-6C8F7126FFE5}.Release|Any CPU.Build.0 = Release|Any CPU + {590E392E-9FB3-49FA-B4DA-6C8F7126FFE5}.Release|x64.ActiveCfg = Release|Any CPU + {590E392E-9FB3-49FA-B4DA-6C8F7126FFE5}.Release|x64.Build.0 = Release|Any CPU + {590E392E-9FB3-49FA-B4DA-6C8F7126FFE5}.Release|x86.ActiveCfg = Release|Any CPU + {590E392E-9FB3-49FA-B4DA-6C8F7126FFE5}.Release|x86.Build.0 = Release|Any CPU + {2B627F66-5A61-4F69-B479-62EEAB603D01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2B627F66-5A61-4F69-B479-62EEAB603D01}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2B627F66-5A61-4F69-B479-62EEAB603D01}.Debug|x64.ActiveCfg = Debug|Any CPU + {2B627F66-5A61-4F69-B479-62EEAB603D01}.Debug|x64.Build.0 = Debug|Any CPU + {2B627F66-5A61-4F69-B479-62EEAB603D01}.Debug|x86.ActiveCfg = Debug|Any CPU + {2B627F66-5A61-4F69-B479-62EEAB603D01}.Debug|x86.Build.0 = Debug|Any CPU + {2B627F66-5A61-4F69-B479-62EEAB603D01}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2B627F66-5A61-4F69-B479-62EEAB603D01}.Release|Any CPU.Build.0 = Release|Any CPU + {2B627F66-5A61-4F69-B479-62EEAB603D01}.Release|x64.ActiveCfg = Release|Any CPU + {2B627F66-5A61-4F69-B479-62EEAB603D01}.Release|x64.Build.0 = Release|Any CPU + {2B627F66-5A61-4F69-B479-62EEAB603D01}.Release|x86.ActiveCfg = Release|Any CPU + {2B627F66-5A61-4F69-B479-62EEAB603D01}.Release|x86.Build.0 = Release|Any CPU + {8863A1BA-2E83-419F-BACB-D4A4156EC71C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8863A1BA-2E83-419F-BACB-D4A4156EC71C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8863A1BA-2E83-419F-BACB-D4A4156EC71C}.Debug|x64.ActiveCfg = Debug|Any CPU + {8863A1BA-2E83-419F-BACB-D4A4156EC71C}.Debug|x64.Build.0 = Debug|Any CPU + {8863A1BA-2E83-419F-BACB-D4A4156EC71C}.Debug|x86.ActiveCfg = Debug|Any CPU + {8863A1BA-2E83-419F-BACB-D4A4156EC71C}.Debug|x86.Build.0 = Debug|Any CPU + {8863A1BA-2E83-419F-BACB-D4A4156EC71C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8863A1BA-2E83-419F-BACB-D4A4156EC71C}.Release|Any CPU.Build.0 = Release|Any CPU + {8863A1BA-2E83-419F-BACB-D4A4156EC71C}.Release|x64.ActiveCfg = Release|Any CPU + {8863A1BA-2E83-419F-BACB-D4A4156EC71C}.Release|x64.Build.0 = Release|Any CPU + {8863A1BA-2E83-419F-BACB-D4A4156EC71C}.Release|x86.ActiveCfg = Release|Any CPU + {8863A1BA-2E83-419F-BACB-D4A4156EC71C}.Release|x86.Build.0 = Release|Any CPU + {7CC31BC4-38EE-40F4-BBBA-9FC2F4CF6283}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7CC31BC4-38EE-40F4-BBBA-9FC2F4CF6283}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7CC31BC4-38EE-40F4-BBBA-9FC2F4CF6283}.Debug|x64.ActiveCfg = Debug|Any CPU + {7CC31BC4-38EE-40F4-BBBA-9FC2F4CF6283}.Debug|x64.Build.0 = Debug|Any CPU + {7CC31BC4-38EE-40F4-BBBA-9FC2F4CF6283}.Debug|x86.ActiveCfg = Debug|Any CPU + {7CC31BC4-38EE-40F4-BBBA-9FC2F4CF6283}.Debug|x86.Build.0 = Debug|Any CPU + {7CC31BC4-38EE-40F4-BBBA-9FC2F4CF6283}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7CC31BC4-38EE-40F4-BBBA-9FC2F4CF6283}.Release|Any CPU.Build.0 = Release|Any CPU + {7CC31BC4-38EE-40F4-BBBA-9FC2F4CF6283}.Release|x64.ActiveCfg = Release|Any CPU + {7CC31BC4-38EE-40F4-BBBA-9FC2F4CF6283}.Release|x64.Build.0 = Release|Any CPU + {7CC31BC4-38EE-40F4-BBBA-9FC2F4CF6283}.Release|x86.ActiveCfg = Release|Any CPU + {7CC31BC4-38EE-40F4-BBBA-9FC2F4CF6283}.Release|x86.Build.0 = Release|Any CPU + {A15263DB-DF65-4A07-8CA1-33A2919501A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A15263DB-DF65-4A07-8CA1-33A2919501A0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A15263DB-DF65-4A07-8CA1-33A2919501A0}.Debug|x64.ActiveCfg = Debug|Any CPU + {A15263DB-DF65-4A07-8CA1-33A2919501A0}.Debug|x64.Build.0 = Debug|Any CPU + {A15263DB-DF65-4A07-8CA1-33A2919501A0}.Debug|x86.ActiveCfg = Debug|Any CPU + {A15263DB-DF65-4A07-8CA1-33A2919501A0}.Debug|x86.Build.0 = Debug|Any CPU + {A15263DB-DF65-4A07-8CA1-33A2919501A0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A15263DB-DF65-4A07-8CA1-33A2919501A0}.Release|Any CPU.Build.0 = Release|Any CPU + {A15263DB-DF65-4A07-8CA1-33A2919501A0}.Release|x64.ActiveCfg = Release|Any CPU + {A15263DB-DF65-4A07-8CA1-33A2919501A0}.Release|x64.Build.0 = Release|Any CPU + {A15263DB-DF65-4A07-8CA1-33A2919501A0}.Release|x86.ActiveCfg = Release|Any CPU + {A15263DB-DF65-4A07-8CA1-33A2919501A0}.Release|x86.Build.0 = Release|Any CPU + {79F870AB-249E-4CA0-9DF0-F265514581DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {79F870AB-249E-4CA0-9DF0-F265514581DF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {79F870AB-249E-4CA0-9DF0-F265514581DF}.Debug|x64.ActiveCfg = Debug|Any CPU + {79F870AB-249E-4CA0-9DF0-F265514581DF}.Debug|x64.Build.0 = Debug|Any CPU + {79F870AB-249E-4CA0-9DF0-F265514581DF}.Debug|x86.ActiveCfg = Debug|Any CPU + {79F870AB-249E-4CA0-9DF0-F265514581DF}.Debug|x86.Build.0 = Debug|Any CPU + {79F870AB-249E-4CA0-9DF0-F265514581DF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {79F870AB-249E-4CA0-9DF0-F265514581DF}.Release|Any CPU.Build.0 = Release|Any CPU + {79F870AB-249E-4CA0-9DF0-F265514581DF}.Release|x64.ActiveCfg = Release|Any CPU + {79F870AB-249E-4CA0-9DF0-F265514581DF}.Release|x64.Build.0 = Release|Any CPU + {79F870AB-249E-4CA0-9DF0-F265514581DF}.Release|x86.ActiveCfg = Release|Any CPU + {79F870AB-249E-4CA0-9DF0-F265514581DF}.Release|x86.Build.0 = Release|Any CPU + {7AA22306-772F-45F4-8F30-97EBD1FC124D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7AA22306-772F-45F4-8F30-97EBD1FC124D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7AA22306-772F-45F4-8F30-97EBD1FC124D}.Debug|x64.ActiveCfg = Debug|Any CPU + {7AA22306-772F-45F4-8F30-97EBD1FC124D}.Debug|x64.Build.0 = Debug|Any CPU + {7AA22306-772F-45F4-8F30-97EBD1FC124D}.Debug|x86.ActiveCfg = Debug|Any CPU + {7AA22306-772F-45F4-8F30-97EBD1FC124D}.Debug|x86.Build.0 = Debug|Any CPU + {7AA22306-772F-45F4-8F30-97EBD1FC124D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7AA22306-772F-45F4-8F30-97EBD1FC124D}.Release|Any CPU.Build.0 = Release|Any CPU + {7AA22306-772F-45F4-8F30-97EBD1FC124D}.Release|x64.ActiveCfg = Release|Any CPU + {7AA22306-772F-45F4-8F30-97EBD1FC124D}.Release|x64.Build.0 = Release|Any CPU + {7AA22306-772F-45F4-8F30-97EBD1FC124D}.Release|x86.ActiveCfg = Release|Any CPU + {7AA22306-772F-45F4-8F30-97EBD1FC124D}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {990CA10C-1EBB-4395-A43A-456B7029D8C9} = {F7F62670-237A-4C93-A30E-CE661C6FC401} + {0D97F83C-B043-48B1-B155-7354C4E84FC0} = {F7F62670-237A-4C93-A30E-CE661C6FC401} + {2F6B1E26-1217-4EFD-874C-05ADEE4C7969} = {F7F62670-237A-4C93-A30E-CE661C6FC401} + {2B627F66-5A61-4F69-B479-62EEAB603D01} = {FECFFD54-338F-4060-9161-1E5770D1DC33} + {8863A1BA-2E83-419F-BACB-D4A4156EC71C} = {F7F62670-237A-4C93-A30E-CE661C6FC401} + {9059393F-4073-9273-0EEC-2B1BA61B620B} = {F7F62670-237A-4C93-A30E-CE661C6FC401} + {7CC31BC4-38EE-40F4-BBBA-9FC2F4CF6283} = {9059393F-4073-9273-0EEC-2B1BA61B620B} + {A15263DB-DF65-4A07-8CA1-33A2919501A0} = {FECFFD54-338F-4060-9161-1E5770D1DC33} + {7AA22306-772F-45F4-8F30-97EBD1FC124D} = {9059393F-4073-9273-0EEC-2B1BA61B620B} + EndGlobalSection +EndGlobal diff --git a/README.md b/README.md new file mode 100644 index 0000000..c5a0fa8 --- /dev/null +++ b/README.md @@ -0,0 +1,79 @@ +# C# Game Project Template + +> A modular template for building games using my C# game engine. + +--- + +## 📦 About + +This repository provides a starting point for developing games using my C# game engine. It is structured to separate shared game logic from platform-specific implementations. I mostly use it for my own projects. + +## ✨ Uses + +- [MonoGame](https://monogame.net/) Integration, for it's windowing, audio, packaging etc. You might wanna get familiar with it since most stuff is not abstracted yet like audio. +- [Yaml](https://yaml.org/) Integration, for serialization +- [LiteNetLib](https://revenantx.github.io/LiteNetLib/index.html) Integration, for networking + +## 🧱 Project Structure + +```txt +📁 Root/ +├── Shared/ # Game logic +├── Platforms/ +│ ├── Desktop/ # Desktop build target (Windows/Linux/macOS) +│ └── Server/ # Headless/server build target +├── Engine/ # Game engine (as a Git submodule) +└── README.md +``` + +## 🚀 Getting Started + +### 1. Clone the Repository (with Submodules) + +```bash +git clone --recursive https://git.syntriax.com/Syntriax/Engine-Template.git +``` + +⚠️ Make sure to use --recursive to initialize all submodules correctly. + +If you've already cloned the repo without submodules, run: + +```bash +git submodule update --init --recursive +``` + +### 2. Write Your Logic Code + +All your universe logic should go inside the Shared/ folder. + +This structure allows your code to be reused across multiple platform targets like Desktop and Server. + +```txt +📁 Root/ +└── Shared/ + └── Behaviours/ + ├── Movement.cs + └── Jump.cs +``` + +### 3. Add Your Objects to Your Universe + +`Shared/UniverseSource.cs` is set up to be your main shared entry point where you can define your universe objects and their behaviours, add systems you see fit etc. + +```txt +📁 Root/ +└── Shared/ + └── UniverseSource.cs +``` + +### 4. Set Project Names (Optional) + +Update every mention of the `MyUniverse` to reflect your project's name and namespace. For example: + +```csharp +MyUniverse.Shared.UniverseSource.ApplyUniverse(universe); +``` + +## 🛠 Requirements + +- .NET SDK (version 9) diff --git a/Shared/.config/dotnet-tools.json b/Shared/.config/dotnet-tools.json new file mode 100644 index 0000000..84ff03d --- /dev/null +++ b/Shared/.config/dotnet-tools.json @@ -0,0 +1,36 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "dotnet-mgcb": { + "version": "3.8.2.1105", + "commands": [ + "mgcb" + ] + }, + "dotnet-mgcb-editor": { + "version": "3.8.2.1105", + "commands": [ + "mgcb-editor" + ] + }, + "dotnet-mgcb-editor-linux": { + "version": "3.8.2.1105", + "commands": [ + "mgcb-editor-linux" + ] + }, + "dotnet-mgcb-editor-windows": { + "version": "3.8.2.1105", + "commands": [ + "mgcb-editor-windows" + ] + }, + "dotnet-mgcb-editor-mac": { + "version": "3.8.2.1105", + "commands": [ + "mgcb-editor-mac" + ] + } + } +} \ No newline at end of file diff --git a/Shared/Behaviours/ExampleBehaviour.cs b/Shared/Behaviours/ExampleBehaviour.cs new file mode 100644 index 0000000..6450303 --- /dev/null +++ b/Shared/Behaviours/ExampleBehaviour.cs @@ -0,0 +1,27 @@ + +using Engine.Core; +using Engine.Core.Debug; + +namespace MyUniverse.Shared.Behaviours; + +public class ExampleBehaviour : Behaviour, IFirstFrameUpdate, ILastFrameUpdate, IUpdate +{ + private ILogger logger = null!; + + public void FirstActiveFrame() + { + logger = Universe.FindRequiredBehaviour(); + + logger.Log(this, "First Frame"); + } + + public void LastActiveFrame() + { + logger.Log(this, $"Last Frame"); + } + + public void Update() + { + logger.Log(this, "Frame"); + } +} diff --git a/Shared/Behaviours/IRotator.cs b/Shared/Behaviours/IRotator.cs new file mode 100644 index 0000000..5614dcd --- /dev/null +++ b/Shared/Behaviours/IRotator.cs @@ -0,0 +1,5 @@ +using Engine.Core; + +namespace MyUniverse.Shared.Behaviours; + +public interface IRotator : IBehaviour; diff --git a/Shared/Behaviours/LinearRotator.cs b/Shared/Behaviours/LinearRotator.cs new file mode 100644 index 0000000..30570f4 --- /dev/null +++ b/Shared/Behaviours/LinearRotator.cs @@ -0,0 +1,13 @@ +using Engine.Core; + +namespace MyUniverse.Shared.Behaviours; + +public class LinearRotator : Behaviour2D, IRotator, IUpdate +{ + private float speed = 20f; + + public void Update() + { + Transform.Rotation += Universe.Time.DeltaTime * speed; + } +} diff --git a/Shared/Behaviours/RotatorToggler.cs b/Shared/Behaviours/RotatorToggler.cs new file mode 100644 index 0000000..8084b81 --- /dev/null +++ b/Shared/Behaviours/RotatorToggler.cs @@ -0,0 +1,31 @@ +using System; +using Engine.Core; +using Engine.Integration.MonoGame; +using Engine.Systems.Input; +using Microsoft.Xna.Framework.Input; + +namespace MyUniverse.Shared.Behaviours; + +public class RotatorToggler : Behaviour2D, IFirstFrameUpdate, ILastFrameUpdate +{ + private IRotator rotator = null!; + private KeyboardInputs inputs = null!; + + public void FirstActiveFrame() + { + rotator = BehaviourController.GetRequiredBehaviour(); + inputs = Universe.FindRequiredBehaviour(); + + inputs.RegisterOnPress(Keys.Space, ToggleRotator); + } + + private void ToggleRotator(IButtonInputs sender, IButtonInputs.ButtonCallbackArguments args) + { + rotator.StateEnable.Enabled = !rotator.StateEnable.Enabled; + } + + public void LastActiveFrame() + { + inputs.UnregisterOnPress(Keys.Space, ToggleRotator); + } +} diff --git a/Shared/Behaviours/TweenRotator.cs b/Shared/Behaviours/TweenRotator.cs new file mode 100644 index 0000000..db49f1c --- /dev/null +++ b/Shared/Behaviours/TweenRotator.cs @@ -0,0 +1,35 @@ +using Engine.Core; +using Engine.Systems.Tween; + +namespace MyUniverse.Shared.Behaviours; + +public class TweenRotator : Behaviour2D, IRotator, IFirstFrameUpdate, ILastFrameUpdate +{ + private float duration = 5f; + private float angle = 180; + private IEasing easeMethod = EaseInOutQuad.Instance; + private ITweenManager tweenManager = null!; + private ITween tween = null!; + + public void FirstActiveFrame() + { + tweenManager = Universe.FindRequiredBehaviour(); + + TweenRotation(); + } + + private void TweenRotation() + { + if (Transform.Rotation >= 360f) + Transform.Rotation -= 360f; + + tween = Transform.TweenRotation(tweenManager, duration, Transform.Rotation + angle) + .Ease(easeMethod) + .OnComplete(TweenRotation); + } + + public void LastActiveFrame() + { + tweenManager.CancelTween(tween); + } +} diff --git a/Shared/Content/Content.mgcb b/Shared/Content/Content.mgcb new file mode 100644 index 0000000..ddc4c36 --- /dev/null +++ b/Shared/Content/Content.mgcb @@ -0,0 +1,15 @@ + +#----------------------------- Global Properties ----------------------------# + +/outputDir:bin/$(Platform) +/intermediateDir:obj/$(Platform) +/platform:DesktopGL +/config: +/profile:Reach +/compress:False + +#-------------------------------- References --------------------------------# + + +#---------------------------------- Content ---------------------------------# + diff --git a/Shared/Shared.csproj b/Shared/Shared.csproj new file mode 100644 index 0000000..eeeea19 --- /dev/null +++ b/Shared/Shared.csproj @@ -0,0 +1,17 @@ + + + net9.0 + enable + MyUniverse.Shared + MyUniverse.Shared + + + + All + + + + + + + diff --git a/Shared/UniverseSource.cs b/Shared/UniverseSource.cs new file mode 100644 index 0000000..54149b8 --- /dev/null +++ b/Shared/UniverseSource.cs @@ -0,0 +1,61 @@ + +using MyUniverse.Shared.Behaviours; + +using Engine.Core; +using Engine.Integration.MonoGame; +using Engine.Systems.Tween; + +namespace MyUniverse.Shared; + +public static class UniverseSource +{ + public static void ApplyCore(IUniverse universe) + { + universe.InstantiateUniverseObject().SetUniverseObject("Core Managers") + .BehaviourController.AddBehaviour() + .BehaviourController.AddBehaviour() + .BehaviourController.AddBehaviour() + .BehaviourController.AddBehaviour() + .BehaviourController.AddBehaviour() + .BehaviourController.AddBehaviour(); + + MonoGameCamera2D camera = universe.InstantiateUniverseObject().SetUniverseObject("Camera") + .BehaviourController.AddBehaviour() + .BehaviourController.AddBehaviour(); + + camera.Zoom = 20f; + } + + public static void ApplyUniverse(IUniverse universe) + { + ApplyCore(universe); + + IUniverseObject exampleObject = universe.InstantiateUniverseObject().SetUniverseObject("Example Object"); + ExampleBehaviour exampleBehaviour = exampleObject.BehaviourController.AddBehaviour(); + + universe.InstantiateUniverseObject() + .SetUniverseObject("Rotating Triangle") + .BehaviourController.AddBehaviour().SetTransform(position: new(10f, 6f), scale: Vector2D.One * 5) + .BehaviourController.AddBehaviour(Shape2D.Triangle, new ColorRGB(0, 128, 128)) + .BehaviourController.AddBehaviour(); + + universe.InstantiateUniverseObject() + .SetUniverseObject("Rotating Pentagon") + .BehaviourController.AddBehaviour().SetTransform(position: new(10f, -6f), scale: Vector2D.One * 5) + .BehaviourController.AddBehaviour(Shape2D.Pentagon, new ColorRGB(128, 0, 128)) + .BehaviourController.AddBehaviour(); + universe.InstantiateUniverseObject() + .SetUniverseObject("Rotating Triangle") + .BehaviourController.AddBehaviour().SetTransform(position: new(-10f, 6f), scale: Vector2D.One * 5) + .BehaviourController.AddBehaviour(Shape2D.Triangle, new ColorRGB(0, 128, 128)) + .BehaviourController.AddBehaviour() + .BehaviourController.AddBehaviour(); + + universe.InstantiateUniverseObject() + .SetUniverseObject("Rotating Pentagon") + .BehaviourController.AddBehaviour().SetTransform(position: new(-10f, -6f), scale: Vector2D.One * 5) + .BehaviourController.AddBehaviour(Shape2D.Pentagon, new ColorRGB(128, 0, 128)) + .BehaviourController.AddBehaviour() + .BehaviourController.AddBehaviour(); + } +}