This commit is contained in:
NGnius 2020-03-12 18:52:02 -04:00
commit 206ec19d1e
18 changed files with 54 additions and 32 deletions

View file

@ -163,6 +163,23 @@ namespace GamecraftModdingAPI.Blocks
MonsterTruckTyre, MonsterTruckTyre,
MotocrossBikeTyre, MotocrossBikeTyre,
CartTyre, CartTyre,
ANDLogicBlock = 170,
NANDLogicBlock,
NORLogicBlock,
NOTLogicBlock,
ORLogicBlock,
XNORLogicBlock,
XORLogicBlock,
AbsoluteMathsBlock,
AdderMathsBlock,
DividerMathsBlock,
SignMathsBlock, //180
MaxMathsBlock,
MinMathsBlock,
MultiplierMathsBlock,
SubtractorMathsBlock,
SimpleConnector,
MeanMathsBlock,
BeachTree1 = 200, BeachTree1 = 200,
BeachTree2, BeachTree2,
BeachTree3, BeachTree3,
@ -181,6 +198,16 @@ namespace GamecraftModdingAPI.Blocks
Flower3, Flower3,
Shrub1, Shrub1,
Shrub2, Shrub2,
Shrub3 Shrub3,
CliffCube,
CliffSlicedCorner,
CliffCornerA,
CliffCornerB,
CliffSlopeA,
CliffSlopeB,
GrassEdge,
GrassEdgeInnerCorner,
GrassEdgeCorner,
GrassEdgeSlope
} }
} }

View file

@ -33,11 +33,15 @@ namespace GamecraftModdingAPI.Blocks
public static ExclusiveGroup SPAWN_POINTS_DISABLED { get { return CommonExclusiveGroups.SPAWN_POINTS_DISABLED_GROUP; } } public static ExclusiveGroup SPAWN_POINTS_DISABLED { get { return CommonExclusiveGroups.SPAWN_POINTS_DISABLED_GROUP; } }
public static ExclusiveGroup OUTPUT_SIGNAL_CHANNELS { get { return CommonExclusiveGroups.CHANNEL_OUTPUT_SIGNAL_GROUPS; } }
/// <summary> /// <summary>
/// The ID of the most recently placed block /// The ID of the most recently placed block
/// </summary> /// </summary>
public static uint LatestBlockID { get { return CommonExclusiveGroups.CurrentBlockEntityID - 1; } } public static uint LatestBlockID {
get
{
//return CommonExclusiveGroups.CurrentBlockEntityID - 1; //TODO
return 0;
}
}
} }
} }

View file

@ -31,7 +31,7 @@ namespace GamecraftModdingAPI.Blocks
{ {
public string Name { get; } = "GamecraftModdingAPIMovementGameEngine"; public string Name { get; } = "GamecraftModdingAPIMovementGameEngine";
public IEntitiesDB entitiesDB { set; private get; } public EntitiesDB entitiesDB { set; private get; }
public bool IsInGame = false; public bool IsInGame = false;

View file

@ -41,7 +41,7 @@ namespace GamecraftModdingAPI.Blocks
IsInGame = true; IsInGame = true;
} }
public IEntitiesDB entitiesDB { get; set; } public EntitiesDB entitiesDB { get; set; }
internal static BlockEntityFactory _blockEntityFactory; //Injected from PlaceBlockEngine internal static BlockEntityFactory _blockEntityFactory; //Injected from PlaceBlockEngine
public void PlaceBlock(BlockIDs block, BlockColors color, byte darkness, float3 position, int uscale, public void PlaceBlock(BlockIDs block, BlockColors color, byte darkness, float3 position, int uscale,

View file

@ -30,7 +30,7 @@ namespace GamecraftModdingAPI.Blocks
{ {
public string Name { get; } = "GamecraftModdingAPIRotationGameEngine"; public string Name { get; } = "GamecraftModdingAPIRotationGameEngine";
public IEntitiesDB entitiesDB { set; private get; } public EntitiesDB entitiesDB { set; private get; }
public bool IsInGame = false; public bool IsInGame = false;

View file

@ -32,7 +32,7 @@ namespace GamecraftModdingAPI.Blocks
{ {
public string Name { get; } = "GamecraftModdingAPISignalGameEngine"; public string Name { get; } = "GamecraftModdingAPISignalGameEngine";
public IEntitiesDB entitiesDB { set; private get; } public EntitiesDB entitiesDB { set; private get; }
public bool IsInGame = false; public bool IsInGame = false;

View file

@ -13,7 +13,7 @@ namespace GamecraftModdingAPI.Blocks
{ {
public string Name { get; } = "GamecraftModdingAPITweakableGameEngine"; public string Name { get; } = "GamecraftModdingAPITweakableGameEngine";
public IEntitiesDB entitiesDB { set; private get; } public EntitiesDB entitiesDB { set; private get; }
public bool IsInGame = false; public bool IsInGame = false;

View file

@ -29,7 +29,7 @@ namespace GamecraftModdingAPI.Commands
/// </summary> /// </summary>
private Action runCommand; private Action runCommand;
public IEntitiesDB entitiesDB { set; private get; } public EntitiesDB entitiesDB { set; private get; }
public void Dispose() public void Dispose()
{ {

View file

@ -20,7 +20,7 @@ namespace GamecraftModdingAPI.Commands
private Action<A> runCommand; private Action<A> runCommand;
public IEntitiesDB entitiesDB { set; private get; } public EntitiesDB entitiesDB { set; private get; }
public void Dispose() public void Dispose()
{ {

View file

@ -20,7 +20,7 @@ namespace GamecraftModdingAPI.Commands
private Action<A,B> runCommand; private Action<A,B> runCommand;
public IEntitiesDB entitiesDB { set; private get; } public EntitiesDB entitiesDB { set; private get; }
public void Dispose() public void Dispose()
{ {

View file

@ -20,7 +20,7 @@ namespace GamecraftModdingAPI.Commands
private Action<A,B,C> runCommand; private Action<A,B,C> runCommand;
public IEntitiesDB entitiesDB { set; private get; } public EntitiesDB entitiesDB { set; private get; }
public void Dispose() public void Dispose()
{ {

View file

@ -36,7 +36,7 @@ namespace GamecraftModdingAPI.Events
/// <param name="onActivated">The operation to do when the event is created</param> /// <param name="onActivated">The operation to do when the event is created</param>
/// <param name="onDestroyed">The operation to do when the event is destroyed (if applicable)</param> /// <param name="onDestroyed">The operation to do when the event is destroyed (if applicable)</param>
/// <returns>The created object</returns> /// <returns>The created object</returns>
public static SimpleEventHandlerEngine CreateAddSimpleHandler(string name, object type, Action<IEntitiesDB> onActivated, Action<IEntitiesDB> onDestroyed) public static SimpleEventHandlerEngine CreateAddSimpleHandler(string name, object type, Action<EntitiesDB> onActivated, Action<EntitiesDB> onDestroyed)
{ {
var engine = new SimpleEventHandlerEngine(onActivated, onDestroyed, type, name); var engine = new SimpleEventHandlerEngine(onActivated, onDestroyed, type, name);
EventManager.AddEventHandler(engine); EventManager.AddEventHandler(engine);

View file

@ -15,7 +15,7 @@ namespace GamecraftModdingAPI.Events
{ {
public string Name { get; } = "GamecraftModdingAPIGameStateBuildEventEmitter" ; public string Name { get; } = "GamecraftModdingAPIGameStateBuildEventEmitter" ;
public IEntitiesDB entitiesDB { set; private get; } public EntitiesDB entitiesDB { set; private get; }
public object type { get; } = EventType.BuildSwitchedTo; public object type { get; } = EventType.BuildSwitchedTo;

View file

@ -15,7 +15,7 @@ namespace GamecraftModdingAPI.Events
{ {
public string Name { get; } = "GamecraftModdingAPIGameStateSimulationEventEmitter" ; public string Name { get; } = "GamecraftModdingAPIGameStateSimulationEventEmitter" ;
public IEntitiesDB entitiesDB { set; private get; } public EntitiesDB entitiesDB { set; private get; }
public object type { get; } = EventType.SimulationSwitchedTo; public object type { get; } = EventType.SimulationSwitchedTo;

View file

@ -21,7 +21,7 @@ namespace GamecraftModdingAPI.Events
public IEntityFactory Factory { private get; set; } public IEntityFactory Factory { private get; set; }
public IEntitiesDB entitiesDB { set; private get; } public EntitiesDB entitiesDB { set; private get; }
public void Ready() { } public void Ready() { }

View file

@ -18,11 +18,11 @@ namespace GamecraftModdingAPI.Events
private bool isActivated = false; private bool isActivated = false;
private readonly Action<IEntitiesDB> onActivated; private readonly Action<EntitiesDB> onActivated;
private readonly Action<IEntitiesDB> onDestroyed; private readonly Action<EntitiesDB> onDestroyed;
public IEntitiesDB entitiesDB { set; private get; } public EntitiesDB entitiesDB { set; private get; }
public void Add(ref ModEventEntityStruct entityView, EGID egid) public void Add(ref ModEventEntityStruct entityView, EGID egid)
{ {
@ -72,7 +72,7 @@ namespace GamecraftModdingAPI.Events
/// <param name="name">The name of the engine</param> /// <param name="name">The name of the engine</param>
/// <param name="simple">A useless parameter to use to avoid Python overload resolution errors</param> /// <param name="simple">A useless parameter to use to avoid Python overload resolution errors</param>
public SimpleEventHandlerEngine(Action activated, Action removed, object type, string name, bool simple = true) public SimpleEventHandlerEngine(Action activated, Action removed, object type, string name, bool simple = true)
: this((IEntitiesDB _) => { activated.Invoke(); }, (IEntitiesDB _) => { removed.Invoke(); }, type, name) { } : this((EntitiesDB _) => { activated.Invoke(); }, (EntitiesDB _) => { removed.Invoke(); }, type, name) { }
/// <summary> /// <summary>
/// Construct the engine /// Construct the engine
@ -81,7 +81,7 @@ namespace GamecraftModdingAPI.Events
/// <param name="removed">The operation to do when the event is destroyed (if applicable)</param> /// <param name="removed">The operation to do when the event is destroyed (if applicable)</param>
/// <param name="type">The type of event to handler</param> /// <param name="type">The type of event to handler</param>
/// <param name="name">The name of the engine</param> /// <param name="name">The name of the engine</param>
public SimpleEventHandlerEngine(Action<IEntitiesDB> activated, Action<IEntitiesDB> removed, object type, string name) public SimpleEventHandlerEngine(Action<EntitiesDB> activated, Action<EntitiesDB> removed, object type, string name)
{ {
this.type = type; this.type = type;
this.Name = name; this.Name = name;

View file

@ -277,12 +277,6 @@
<Reference Include="Unity.Burst.Unsafe"> <Reference Include="Unity.Burst.Unsafe">
<HintPath>..\ref\Gamecraft_Data\Managed\Unity.Burst.Unsafe.dll</HintPath> <HintPath>..\ref\Gamecraft_Data\Managed\Unity.Burst.Unsafe.dll</HintPath>
</Reference> </Reference>
<Reference Include="Unity.Cloud.UserReporting.Client">
<HintPath>..\ref\Gamecraft_Data\Managed\Unity.Cloud.UserReporting.Client.dll</HintPath>
</Reference>
<Reference Include="Unity.Cloud.UserReporting.Plugin">
<HintPath>..\ref\Gamecraft_Data\Managed\Unity.Cloud.UserReporting.Plugin.dll</HintPath>
</Reference>
<Reference Include="Unity.Collections"> <Reference Include="Unity.Collections">
<HintPath>..\ref\Gamecraft_Data\Managed\Unity.Collections.dll</HintPath> <HintPath>..\ref\Gamecraft_Data\Managed\Unity.Collections.dll</HintPath>
</Reference> </Reference>
@ -541,9 +535,6 @@
<Reference Include="uREPL"> <Reference Include="uREPL">
<HintPath>..\ref\Gamecraft_Data\Managed\uREPL.dll</HintPath> <HintPath>..\ref\Gamecraft_Data\Managed\uREPL.dll</HintPath>
</Reference> </Reference>
<Reference Include="UserReporting">
<HintPath>..\ref\Gamecraft_Data\Managed\UserReporting.dll</HintPath>
</Reference>
<Reference Include="VisualProfiler"> <Reference Include="VisualProfiler">
<HintPath>..\ref\Gamecraft_Data\Managed\VisualProfiler.dll</HintPath> <HintPath>..\ref\Gamecraft_Data\Managed\VisualProfiler.dll</HintPath>
</Reference> </Reference>

View file

@ -13,7 +13,7 @@ namespace GamecraftModdingAPI.Utility
{ {
public string Name { get; } = "GamecraftModdingAPIGameStateGameEngine"; public string Name { get; } = "GamecraftModdingAPIGameStateGameEngine";
public IEntitiesDB entitiesDB { set; private get; } public EntitiesDB entitiesDB { set; private get; }
private bool _isInGame = false; private bool _isInGame = false;