routecommand attempt1
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
using Newtonsoft.Json;
|
using LibNoise.Primitive;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
namespace RH_Engine
|
namespace RH_Engine
|
||||||
{
|
{
|
||||||
@@ -148,7 +150,57 @@ namespace RH_Engine
|
|||||||
|
|
||||||
public string RouteCommand()
|
public string RouteCommand()
|
||||||
{
|
{
|
||||||
return "";
|
ImprovedPerlin improvedPerlin = new ImprovedPerlin(0, LibNoise.NoiseQuality.Best);
|
||||||
|
|
||||||
|
dynamic payload = new
|
||||||
|
{
|
||||||
|
id = "route/add",
|
||||||
|
data = new
|
||||||
|
{
|
||||||
|
nodes = new dynamic[]
|
||||||
|
{
|
||||||
|
new
|
||||||
|
{
|
||||||
|
pos = GetPos(0, improvedPerlin),
|
||||||
|
dir = GetDir()
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
pos = GetPos(1, improvedPerlin),
|
||||||
|
dir = GetDir()
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
pos = GetPos(2, improvedPerlin),
|
||||||
|
dir = GetDir()
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
pos = GetPos(3, improvedPerlin),
|
||||||
|
dir = GetDir()
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
pos = GetPos(4, improvedPerlin),
|
||||||
|
dir = GetDir()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Console.WriteLine(JsonConvert.SerializeObject(Payload(payload)));
|
||||||
|
return JsonConvert.SerializeObject(Payload(payload));
|
||||||
|
}
|
||||||
|
|
||||||
|
private int[] GetPos(int n, ImprovedPerlin improvedPerlin)
|
||||||
|
{
|
||||||
|
return new int[] { (int)improvedPerlin.GetValue(n) * 50 * n, 0, (int)improvedPerlin.GetValue(n) * 50 };
|
||||||
|
}
|
||||||
|
|
||||||
|
private int[] GetDir()
|
||||||
|
{
|
||||||
|
Random rng = new Random();
|
||||||
|
int[] dir = {rng.Next(5), rng.Next(5), rng.Next(5)};
|
||||||
|
return dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string FollowRouteCommand()
|
public string FollowRouteCommand()
|
||||||
|
|||||||
@@ -13,11 +13,11 @@ namespace RH_Engine
|
|||||||
internal class Program
|
internal class Program
|
||||||
{
|
{
|
||||||
private static PC[] PCs = {
|
private static PC[] PCs = {
|
||||||
//new PC("DESKTOP-TV73FK0", "woute"),
|
|
||||||
//new PC("DESKTOP-M2CIH87", "Fabian"),
|
//new PC("DESKTOP-M2CIH87", "Fabian"),
|
||||||
new PC("T470S", "Shinichi"),
|
//new PC("T470S", "Shinichi"),
|
||||||
//new PC("DESKTOP-DHS478C", "semme"),
|
new PC("DESKTOP-DHS478C", "semme"),
|
||||||
new PC("NA", "Ralf"),
|
//new PC("DESKTOP-TV73FKO", "Wouter"),
|
||||||
|
new PC("DESKTOP-SINMKT1", "Ralf"),
|
||||||
new PC("NA", "Bart") };
|
new PC("NA", "Bart") };
|
||||||
private static void Main(string[] args)
|
private static void Main(string[] args)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="LibNoise" Version="0.2.0" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user