Skip to content

Commit

Permalink
Make flow struct stuff internal as it isn't needed publicly
Browse files Browse the repository at this point in the history
  • Loading branch information
AnimatedSwine37 committed Nov 29, 2022
1 parent 75cd6a5 commit 790eddf
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 73 deletions.
20 changes: 18 additions & 2 deletions p5rpc.lib.interfaces/FlowFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,23 @@ namespace p5rpc.lib.interfaces
{
public class FlowFunctions
{
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
/// <summary>
/// Groups of flow functions
/// </summary>
public enum FlowFunctionGroupType
{
Common,
Field,
AI,
Social,
Facility,
Net
}

/// <summary>
/// The name of every flow function mapped to their id
/// </summary>
public enum FlowFunction
{
SYNC = 0,
Expand Down Expand Up @@ -2174,7 +2191,6 @@ public enum FlowFunction
NET_START_AUDIENCE = 20486,
NET_STOP_AUDIENCE = 20487,
}


#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
}
}
69 changes: 0 additions & 69 deletions p5rpc.lib.interfaces/FlowStruct.cs

This file was deleted.

6 changes: 5 additions & 1 deletion p5rpc.lib.interfaces/IFlowCaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
using System.Text;
using System.Threading.Tasks;
using static p5rpc.lib.interfaces.FlowFunctions;
using static p5rpc.lib.interfaces.FlowStruct;

namespace p5rpc.lib.interfaces
{
/// <summary>
/// An interface for calling flowscript functions
/// </summary>
public interface IFlowCaller
{
/// <summary>
Expand Down Expand Up @@ -53,6 +55,7 @@ public interface IFlowCaller


// All of the flow functions!
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
public int AI_RND(int param1);
public void AI_ACT_ATTACK();
public int AI_TAR_RND();
Expand Down Expand Up @@ -2216,6 +2219,7 @@ public interface IFlowCaller
public void CMM_SYNC_POINT_ID_ST();
public void EVT_BACKLOG_STOP(int param1);
public void EVT_MOUSE_INPUT_ENABLE();
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member

}
}
2 changes: 1 addition & 1 deletion p5rpc.lib/Components/FlowCaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Text;
using static p5rpc.lib.Components.FlowStruct;
using static p5rpc.lib.interfaces.FlowFunctions;
using static p5rpc.lib.interfaces.FlowStruct;
using static System.Runtime.InteropServices.JavaScript.JSType;

namespace p5rpc.lib.Components
Expand Down
44 changes: 44 additions & 0 deletions p5rpc.lib/Components/FlowStruct.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace p5rpc.lib.Components
{
internal unsafe class FlowStruct
{
[StructLayout(LayoutKind.Sequential)]
internal struct FlowFunctionGroup
{
internal FlowFunctionInfo* Functions { get; }
internal long NumFunctions { get; }
}

[StructLayout(LayoutKind.Sequential)]
internal struct FlowFunctionInfo
{
internal nuint Function { get; }
internal long NumArguments { get; }
internal char* Name { get; }
}

[StructLayout(LayoutKind.Explicit)]
internal struct FlowContext
{
[FieldOffset(0x2c)]
internal short NumArgs;
[FieldOffset(0x2e)]
internal fixed byte ArgTypes[32];
[FieldOffset(0x58)]
internal fixed long Arguments[32];
[FieldOffset(0x1D8)]
internal int IntReturnValue;
[FieldOffset(0x1D8)]
internal float FloatReturnValue;
[FieldOffset(0x224)]
internal int WaitingFlag;
}
}
}

0 comments on commit 790eddf

Please sign in to comment.