first commit
This commit is contained in:
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
bin/
|
||||
obj/
|
||||
/packages/
|
||||
riderModule.iml
|
||||
/_ReSharper.Caches/
|
||||
5
.idea/.idea.RobotIntelFinal/.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
5
.idea/.idea.RobotIntelFinal/.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
@@ -0,0 +1,5 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||
</state>
|
||||
</component>
|
||||
25
.idea/.idea.RobotIntelFinal/.idea/contentModel.xml
generated
Normal file
25
.idea/.idea.RobotIntelFinal/.idea/contentModel.xml
generated
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ContentModelStore">
|
||||
<e p="$PROJECT_DIR$" t="IncludeFlat">
|
||||
<e p="ConsoleApp" t="IncludeRecursive">
|
||||
<e p="bin" t="ExcludeRecursive" />
|
||||
<e p="ConsoleApp.csproj" t="IncludeRecursive" />
|
||||
<e p="CoreModule.cs" t="Include" />
|
||||
<e p="IModule.cs" t="Include" />
|
||||
<e p="obj" t="ExcludeRecursive">
|
||||
<e p="Debug" t="Include">
|
||||
<e p="netcoreapp3.1" t="Include">
|
||||
<e p="ConsoleApp.AssemblyInfo.cs" t="Include" />
|
||||
</e>
|
||||
</e>
|
||||
</e>
|
||||
<e p="Program.cs" t="Include" />
|
||||
</e>
|
||||
<e p="packages" t="ExcludeRecursive" />
|
||||
<e p="RobotIntelFinal.sln" t="IncludeFlat" />
|
||||
</e>
|
||||
<e p="$USER_HOME$/Library/Caches/JetBrains/Rider2020.2/extResources" t="IncludeRecursive" />
|
||||
<e p="$USER_HOME$/Library/Caches/JetBrains/Rider2020.2/resharper-host/local/Transient/Rider/v202/SolutionCaches/_RobotIntelFinal.-1349721189.00" t="ExcludeRecursive" />
|
||||
</component>
|
||||
</project>
|
||||
4
.idea/.idea.RobotIntelFinal/.idea/encodings.xml
generated
Normal file
4
.idea/.idea.RobotIntelFinal/.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||
</project>
|
||||
8
.idea/.idea.RobotIntelFinal/.idea/indexLayout.xml
generated
Normal file
8
.idea/.idea.RobotIntelFinal/.idea/indexLayout.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ContentModelUserStore">
|
||||
<attachedFolders />
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
</project>
|
||||
8
.idea/.idea.RobotIntelFinal/.idea/modules.xml
generated
Normal file
8
.idea/.idea.RobotIntelFinal/.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/.idea.RobotIntelFinal/riderModule.iml" filepath="$PROJECT_DIR$/.idea/.idea.RobotIntelFinal/riderModule.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/.idea.RobotIntelFinal/.idea/projectSettingsUpdater.xml
generated
Normal file
6
.idea/.idea.RobotIntelFinal/.idea/projectSettingsUpdater.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RiderProjectSettingsUpdater">
|
||||
<option name="vcsConfiguration" value="2" />
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/.idea.RobotIntelFinal/.idea/vcs.xml
generated
Normal file
6
.idea/.idea.RobotIntelFinal/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
144
.idea/.idea.RobotIntelFinal/.idea/workspace.xml
generated
Normal file
144
.idea/.idea.RobotIntelFinal/.idea/workspace.xml
generated
Normal file
@@ -0,0 +1,144 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoGeneratedRunConfigurationManager">
|
||||
<projectFile>Simulator/Simulator.csproj</projectFile>
|
||||
<projectFile>ConsoleApp/ConsoleApp.csproj</projectFile>
|
||||
</component>
|
||||
<component name="BranchesTreeState">
|
||||
<expand>
|
||||
<path>
|
||||
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
|
||||
<item name="LOCAL_ROOT" type="e8cecc67:BranchNodeDescriptor" />
|
||||
</path>
|
||||
</expand>
|
||||
<select />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="dafcaeb7-80aa-43a3-a480-786fafb78c0b" name="Default Changelist" comment="">
|
||||
<change afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/ConsoleApp/CoreModule.cs" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/ConsoleApp/IModule.cs" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/RobotIntelFinal.sln" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/Simulator/Networking/INetworkInterface.cs" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/Simulator/Networking/INetworkInterfaceFactory.cs" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/Simulator/Networking/NetworkInterface.cs" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/Simulator/Networking/NetworkInterfaceFactory.cs" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/Simulator/SimulatorModule.cs" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="IdeDocumentHistory">
|
||||
<option name="CHANGED_PATHS">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/Simulator/Program.cs" />
|
||||
<option value="$PROJECT_DIR$/Simulator/CoreModule.cs" />
|
||||
<option value="$PROJECT_DIR$/ConsoleApp/Program.cs" />
|
||||
<option value="$PROJECT_DIR$/ConsoleApp/CoreModule.cs" />
|
||||
<option value="$PROJECT_DIR$/ConsoleApp/IModule.cs" />
|
||||
<option value="$PROJECT_DIR$/Simulator/SimulatorModule.cs" />
|
||||
<option value="$PROJECT_DIR$/Simulator/NetworkInterfaceFactory.cs" />
|
||||
<option value="$PROJECT_DIR$/Simulator/INetworkInterfaceFactory.cs" />
|
||||
<option value="$PROJECT_DIR$/Simulator/NetworkInterface.cs" />
|
||||
<option value="$PROJECT_DIR$/Simulator/Networking/NetworkInterfaceFactory.cs" />
|
||||
<option value="$PROJECT_DIR$/Simulator/Networking/INetworkInterfaceFactory.cs" />
|
||||
<option value="$PROJECT_DIR$/Simulator/Networking/INetworkInterface.cs" />
|
||||
<option value="$PROJECT_DIR$/Simulator/Networking/NetworkInterface.cs" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectId" id="1lIZ7IfsUjzqV2Jb1obOFvGFAfp" />
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
|
||||
<ConfirmationsSetting value="2" id="Add" />
|
||||
</component>
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="vue.rearranger.settings.migration" value="true" />
|
||||
</component>
|
||||
<component name="RunManager" selected=".NET Project.Simulator">
|
||||
<configuration name="ConsoleApp" type="DotNetProject" factoryName=".NET Project">
|
||||
<option name="EXE_PATH" value="" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="PASS_PARENT_ENVS" value="1" />
|
||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||
<option name="USE_MONO" value="0" />
|
||||
<option name="RUNTIME_ARGUMENTS" value="" />
|
||||
<option name="PROJECT_PATH" value="$PROJECT_DIR$/ConsoleApp/ConsoleApp.csproj" />
|
||||
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
|
||||
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
||||
<option name="PROJECT_KIND" value="DotNetCore" />
|
||||
<option name="PROJECT_TFM" value="" />
|
||||
<method v="2">
|
||||
<option name="Build" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="Simulator" type="DotNetProject" factoryName=".NET Project">
|
||||
<option name="EXE_PATH" value="" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="PASS_PARENT_ENVS" value="1" />
|
||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||
<option name="USE_MONO" value="0" />
|
||||
<option name="RUNTIME_ARGUMENTS" value="" />
|
||||
<option name="PROJECT_PATH" value="$PROJECT_DIR$/Simulator/Simulator.csproj" />
|
||||
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
|
||||
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
||||
<option name="PROJECT_KIND" value="DotNetCore" />
|
||||
<option name="PROJECT_TFM" value="" />
|
||||
<method v="2">
|
||||
<option name="Build" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="dafcaeb7-80aa-43a3-a480-786fafb78c0b" name="Default Changelist" comment="" />
|
||||
<created>1607286398679</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1607286398679</updated>
|
||||
<workItem from="1607286402206" duration="6845000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="3" />
|
||||
</component>
|
||||
<component name="UnityProjectConfiguration" hasMinimizedUI="null" />
|
||||
<component name="UnityUnitTestConfiguration" currentTestLauncher="NUnit" />
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
<option name="TAB_STATES">
|
||||
<map>
|
||||
<entry key="MAIN">
|
||||
<value>
|
||||
<State />
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="true" />
|
||||
</component>
|
||||
<component name="WindowStateProjectService">
|
||||
<state x="1640" y="-86" key="Rider.ProjectTemplateDialog.Size" timestamp="1607287214952">
|
||||
<screen x="1440" y="-782" width="1200" height="1920" />
|
||||
</state>
|
||||
<state x="1640" y="-86" key="Rider.ProjectTemplateDialog.Size/0.0.1440.900/2640.-782.1200.1920/1440.-782.1200.1920@1440.-782.1200.1920" timestamp="1607286605974" />
|
||||
<state x="1640" y="-86" key="Rider.ProjectTemplateDialog.Size/0.25.1440.798/2640.-757.1200.1895/1440.-782.1200.1920@1440.-782.1200.1920" timestamp="1607287214952" />
|
||||
</component>
|
||||
</project>
|
||||
12
ConsoleApp/ConsoleApp.csproj
Normal file
12
ConsoleApp/ConsoleApp.csproj
Normal file
@@ -0,0 +1,12 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DryIoc.dll" Version="4.5.2" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
7
ConsoleApp/CoreModule.cs
Normal file
7
ConsoleApp/CoreModule.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Final
|
||||
{
|
||||
public class CoreModule
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
9
ConsoleApp/IModule.cs
Normal file
9
ConsoleApp/IModule.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using DryIoc;
|
||||
namespace ConsoleApp
|
||||
{
|
||||
public interface IModule
|
||||
{
|
||||
void Register(IContainer container);
|
||||
void Resolve(IContainer container);
|
||||
}
|
||||
}
|
||||
12
ConsoleApp/Program.cs
Normal file
12
ConsoleApp/Program.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace ConsoleApp
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("Hello World!");
|
||||
}
|
||||
}
|
||||
}
|
||||
16
RobotIntelFinal.sln
Normal file
16
RobotIntelFinal.sln
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp", "ConsoleApp\ConsoleApp.csproj", "{180E12B5-E776-4D0A-8F3C-F667C0B6777B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{180E12B5-E776-4D0A-8F3C-F667C0B6777B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{180E12B5-E776-4D0A-8F3C-F667C0B6777B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{180E12B5-E776-4D0A-8F3C-F667C0B6777B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{180E12B5-E776-4D0A-8F3C-F667C0B6777B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
7
Simulator/Networking/INetworkInterface.cs
Normal file
7
Simulator/Networking/INetworkInterface.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Final.Simulator
|
||||
{
|
||||
public interface INetworkInterface
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
10
Simulator/Networking/INetworkInterfaceFactory.cs
Normal file
10
Simulator/Networking/INetworkInterfaceFactory.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Dynamic;
|
||||
|
||||
namespace Final.Simulator
|
||||
{
|
||||
public interface INetworkInterfaceFactory
|
||||
{
|
||||
INetworkInterface Create(UInt16 port);
|
||||
}
|
||||
}
|
||||
42
Simulator/Networking/NetworkInterface.cs
Normal file
42
Simulator/Networking/NetworkInterface.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Final.Simulator
|
||||
{
|
||||
public class NetworkInterface : INetworkInterface
|
||||
{
|
||||
public UdpClient UdpClient { get; }
|
||||
public Action<string> MessageRecieved;
|
||||
|
||||
private UInt16 _remotePort { get; }
|
||||
private IPAddress _remoteIP { get; }
|
||||
private UInt16 _localPort { get; }
|
||||
private IPAddress _localIP { get; }
|
||||
|
||||
public NetworkInterface(IPAddress localIp, UInt16 localPort, )
|
||||
{
|
||||
_remoteEp = new IPEndPoint(IPAddress.Parse("127.0.0.1"), port);
|
||||
UdpClient = new UdpClient();
|
||||
Task.Run(() => RegisterForMessages());
|
||||
|
||||
}
|
||||
|
||||
private void RegisterForMessages()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
var remoteEP = new IPEndPoint(_remoteIP, _remotePort);
|
||||
MessageRecieved.Invoke(UdpClient.Receive(ref remoteEP).ToString());
|
||||
UdpClient.Send(new byte[] {1}, 1, remoteEP);
|
||||
}
|
||||
}
|
||||
|
||||
private void TMP(object o)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
7
Simulator/Networking/NetworkInterfaceFactory.cs
Normal file
7
Simulator/Networking/NetworkInterfaceFactory.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Final.Simulator
|
||||
{
|
||||
public class NetworkInterfaceFactory : INetworkInterfaceFactory
|
||||
{
|
||||
public INetworkInterface Create(ushort port) => new NetworkInterface(port);
|
||||
}
|
||||
}
|
||||
18
Simulator/Networking/SimulatorModule.cs
Normal file
18
Simulator/Networking/SimulatorModule.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using ConsoleApp;
|
||||
using DryIoc;
|
||||
|
||||
namespace Final.Simulator
|
||||
{
|
||||
public class SimulatorModule : IModule
|
||||
{
|
||||
public void Register(IContainer container)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Resolve(IContainer container)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Simulator/Program.cs
Normal file
12
Simulator/Program.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace Simulator
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("Hello World!");
|
||||
}
|
||||
}
|
||||
}
|
||||
16
Simulator/Simulator.csproj
Normal file
16
Simulator/Simulator.csproj
Normal file
@@ -0,0 +1,16 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ConsoleApp\ConsoleApp.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="UdpMessages" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user