mirror of
https://github.com/simtactics/SimAINet.git
synced 2025-03-23 04:02:20 +00:00
Slight refractor
- Bumped unit tests to .NET 8
This commit is contained in:
parent
3e3958c67f
commit
e7184729df
19 changed files with 617 additions and 614 deletions
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<IsPackable>false</IsPackable>
|
||||
|
@ -9,14 +9,15 @@
|
|||
<RootNamespace>SimAntics.Tests</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.collector" Version="1.2.1">
|
||||
<PackageReference Include="coverlet.collector" Version="1.3.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
using System.Diagnostics;
|
||||
using SimAI;
|
||||
using Xunit;
|
||||
|
||||
namespace SimAI.Tests;
|
||||
namespace SimAntics.Tests;
|
||||
|
||||
public class VMClockTest
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
||||
// If a copy of the MPL was not distributed with this file, You can obtain one at
|
||||
// http://mozilla.org/MPL/2.0/.
|
||||
namespace SimAI;
|
||||
namespace SimAntics;
|
||||
|
||||
public enum Direction
|
||||
{
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
||||
// If a copy of the MPL was not distributed with this file, You can obtain one at
|
||||
// http://mozilla.org/MPL/2.0/.
|
||||
using SimAI;
|
||||
|
||||
namespace SimAntics.Engine.Entities;
|
||||
|
||||
public class VMEntityRTTI
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
||||
// If a copy of the MPL was not distributed with this file, You can obtain one at
|
||||
// http://mozilla.org/MPL/2.0/.
|
||||
namespace SimAI.Engine;
|
||||
namespace SimAntics.Engine;
|
||||
|
||||
public class VMMemory
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// http://mozilla.org/MPL/2.0/.
|
||||
using SimAntics.Engine.Entities;
|
||||
|
||||
namespace SimAI.Engine;
|
||||
namespace SimAntics.Engine;
|
||||
|
||||
public class VMScheduler
|
||||
{
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
// http://mozilla.org/MPL/2.0/.
|
||||
|
||||
using SimAntics.Engine.Entities;
|
||||
using SimAntics.Marshals;
|
||||
|
||||
namespace SimAI.Engine;
|
||||
namespace SimAntics.Engine;
|
||||
|
||||
/// <summary>
|
||||
/// Holds information about the execution of a routine
|
||||
|
|
|
@ -5,9 +5,7 @@
|
|||
#define IDE_COMPAT
|
||||
#endif
|
||||
|
||||
using SimAntics.Engine.Entities;
|
||||
|
||||
namespace SimAI.Engine;
|
||||
namespace SimAntics.Engine;
|
||||
|
||||
/// <summary>
|
||||
/// Compatibility class
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
global using SimAI.Engine;
|
||||
global using SimAI.Marshals;
|
||||
global using SimAntics.Engine;
|
||||
global using SimAntics.Marshals;
|
||||
global using SimAntics.Engine.Entities;
|
|
@ -1,7 +1,7 @@
|
|||
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
||||
// If a copy of the MPL was not distributed with this file, You can obtain one at
|
||||
// http://mozilla.org/MPL/2.0/.
|
||||
namespace SimAI;
|
||||
namespace SimAntics;
|
||||
|
||||
public interface IVM
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
||||
// If a copy of the MPL was not distributed with this file, You can obtain one at
|
||||
// http://mozilla.org/MPL/2.0/.
|
||||
namespace SimAI.Interfaces;
|
||||
namespace SimAntics.Interfaces;
|
||||
|
||||
public interface VMIMotiveDecay : VMSerializable
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
||||
// If a copy of the MPL was not distributed with this file, You can obtain one at
|
||||
// http://mozilla.org/MPL/2.0/.
|
||||
namespace SimAI.Interfaces;
|
||||
namespace SimAntics.Interfaces;
|
||||
|
||||
public interface VMSerializable
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
||||
// If a copy of the MPL was not distributed with this file, You can obtain one at
|
||||
// http://mozilla.org/MPL/2.0/.
|
||||
namespace SimAI.Marshals;
|
||||
namespace SimAntics.Marshals;
|
||||
|
||||
public class VMMarshal
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
||||
// If a copy of the MPL was not distributed with this file, You can obtain one at
|
||||
// http://mozilla.org/MPL/2.0/.
|
||||
namespace SimAI.Marshals;
|
||||
namespace SimAntics.Marshals;
|
||||
|
||||
public class VMStackFrameMarshal
|
||||
{
|
||||
|
@ -56,7 +56,7 @@ public class VMStackFrameMarshal
|
|||
writer.Write(Callee);
|
||||
writer.Write(StackObject);
|
||||
writer.Write(CodeOwnerGUID);
|
||||
writer.Write((Locals == null) ? -1 : Locals.Length);
|
||||
writer.Write(Locals == null ? -1 : Locals.Length);
|
||||
//if (Locals != null) writer.Write(VMSerializableUtils.ToByteArray(Locals));
|
||||
//writer.Write((Args == null) ? -1 : Args.Length);
|
||||
//if (Args != null) writer.Write(VMSerializableUtils.ToByteArray(Args));
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
||||
// If a copy of the MPL was not distributed with this file, You can obtain one at
|
||||
// http://mozilla.org/MPL/2.0/.
|
||||
using SimAI;
|
||||
using SimAntics.Engine;
|
||||
using SimAntics.Engine.Entities;
|
||||
|
||||
namespace SimAI;
|
||||
namespace SimAntics;
|
||||
|
||||
/// <summary>
|
||||
/// VM is an abstract class that contains the
|
||||
|
@ -130,7 +132,7 @@ public abstract class VM : IVM
|
|||
if (Entities.Contains(entity))
|
||||
{
|
||||
// Context.ObjectQueries.RemoveObject(entity);
|
||||
this.Entities.Remove(entity);
|
||||
Entities.Remove(entity);
|
||||
ObjectsById.Remove(entity.ObjectID);
|
||||
// Scheduler.DescheduleTick(entity);
|
||||
if (entity.ObjectID < ObjectId) ObjectId = entity.ObjectID; //this id is now the smallest free object id.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// If a copy of the MPL was not distributed with this file, You can obtain one at
|
||||
// http://mozilla.org/MPL/2.0/.
|
||||
|
||||
namespace SimAI;
|
||||
namespace SimAntics;
|
||||
|
||||
public class VMClock
|
||||
{
|
||||
|
@ -19,7 +19,7 @@ public class VMClock
|
|||
public int FirePercent { get; set; }
|
||||
public long UTCStart = DateTime.UtcNow.Ticks;
|
||||
|
||||
public int TimeOfDay => (Hours >= 6 && Hours < 18) ? 0 : 1;
|
||||
public int TimeOfDay => Hours >= 6 && Hours < 18 ? 0 : 1;
|
||||
public int Seconds => MinuteFractions * 60 / TicksPerMinute;
|
||||
|
||||
public DateTime UTCNow => new DateTime(UTCStart).AddSeconds(Ticks / 30.0);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
||||
// If a copy of the MPL was not distributed with this file, You can obtain one at
|
||||
// http://mozilla.org/MPL/2.0/.
|
||||
namespace SimAI;
|
||||
namespace SimAntics;
|
||||
|
||||
public class VMContext
|
||||
{
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
// If a copy of the MPL was not distributed with this file, You can obtain one at
|
||||
// http://mozilla.org/MPL/2.0/.
|
||||
using System.Text;
|
||||
using SimAntics.Engine;
|
||||
|
||||
namespace SimAI;
|
||||
namespace SimAntics;
|
||||
|
||||
public class VMSimanticsException : Exception
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue