2020-05-18 03:19:16 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
using RobocraftX.Blocks;
|
2020-07-10 22:30:58 +00:00
|
|
|
|
using RobocraftX.Common;
|
2020-05-18 03:19:16 +00:00
|
|
|
|
using Svelto.ECS;
|
|
|
|
|
using Unity.Mathematics;
|
|
|
|
|
|
|
|
|
|
using GamecraftModdingAPI;
|
|
|
|
|
using GamecraftModdingAPI.Utility;
|
|
|
|
|
|
|
|
|
|
namespace GamecraftModdingAPI.Blocks
|
|
|
|
|
{
|
|
|
|
|
public class ConsoleBlock : Block
|
|
|
|
|
{
|
2020-07-13 19:55:48 +00:00
|
|
|
|
public ConsoleBlock(EGID id): base(id)
|
2020-05-18 03:19:16 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-13 19:55:48 +00:00
|
|
|
|
public ConsoleBlock(uint id): base(new EGID(id, CommonExclusiveGroups.BUILD_CONSOLE_BLOCK_GROUP))
|
2020-05-18 03:19:16 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// custom console block properties
|
|
|
|
|
|
2020-07-15 20:46:48 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Setting a nonexistent command will crash the game when switching to simulation
|
|
|
|
|
/// </summary>
|
2020-05-18 03:19:16 +00:00
|
|
|
|
public string Command
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2020-07-15 19:58:24 +00:00
|
|
|
|
return BlockEngine.GetBlockInfo(this, (ConsoleBlockEntityStruct st) => st.commandName);
|
2020-05-18 03:19:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
2020-07-15 19:58:24 +00:00
|
|
|
|
BlockEngine.SetBlockInfo(this, (ref ConsoleBlockEntityStruct st, string val) => st.commandName.Set(val),
|
|
|
|
|
value);
|
2020-05-18 03:19:16 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string Arg1
|
|
|
|
|
{
|
2020-07-15 19:58:24 +00:00
|
|
|
|
get => BlockEngine.GetBlockInfo(this, (ConsoleBlockEntityStruct st) => st.arg1);
|
2020-05-18 03:19:16 +00:00
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
2020-07-15 19:58:24 +00:00
|
|
|
|
BlockEngine.SetBlockInfo(this, (ref ConsoleBlockEntityStruct st, string val) => st.arg1.Set(val),
|
|
|
|
|
value);
|
2020-05-18 03:19:16 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string Arg2
|
|
|
|
|
{
|
2020-07-15 19:58:24 +00:00
|
|
|
|
get => BlockEngine.GetBlockInfo(this, (ConsoleBlockEntityStruct st) => st.arg2);
|
2020-05-18 03:19:16 +00:00
|
|
|
|
|
2020-07-15 19:58:24 +00:00
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
BlockEngine.SetBlockInfo(this, (ref ConsoleBlockEntityStruct st, string val) => st.arg2.Set(val),
|
|
|
|
|
value);
|
|
|
|
|
}
|
2020-05-18 03:19:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string Arg3
|
|
|
|
|
{
|
2020-07-15 19:58:24 +00:00
|
|
|
|
get => BlockEngine.GetBlockInfo(this, (ConsoleBlockEntityStruct st) => st.arg3);
|
2020-05-18 03:19:16 +00:00
|
|
|
|
|
2020-07-15 19:58:24 +00:00
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
BlockEngine.SetBlockInfo(this, (ref ConsoleBlockEntityStruct st, string val) => st.arg3.Set(val),
|
|
|
|
|
value);
|
|
|
|
|
}
|
2020-05-18 03:19:16 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|