|
|
@@ -5,6 +5,7 @@ using RobocraftX.Character; |
|
|
|
using RobocraftX.Character.Movement; |
|
|
|
using RobocraftX.Common.Players; |
|
|
|
using RobocraftX.Common.Input; |
|
|
|
using RobocraftX.CR.MachineEditing.BoxSelect; |
|
|
|
using RobocraftX.Physics; |
|
|
|
using RobocraftX.Blocks.Ghost; |
|
|
|
using RobocraftX.Character.Camera; |
|
|
@@ -408,5 +409,26 @@ namespace GamecraftModdingAPI.Players |
|
|
|
|
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
public unsafe Block[] GetSelectedBlocks(uint playerid) |
|
|
|
{ |
|
|
|
if (!entitiesDB.Exists<BoxSelectStateEntityStruct>(playerid, |
|
|
|
BoxSelectExclusiveGroups.BoxSelectVolumeExclusiveGroup)) |
|
|
|
return new Block[0]; |
|
|
|
var state = entitiesDB.QueryEntity<BoxSelectStateEntityStruct>(playerid, |
|
|
|
BoxSelectExclusiveGroups.BoxSelectVolumeExclusiveGroup); |
|
|
|
var blocks = entitiesDB.QueryEntity<SelectedBlocksStruct>(playerid, |
|
|
|
BoxSelectExclusiveGroups.BoxSelectVolumeExclusiveGroup); |
|
|
|
if (!state.active) return new Block[0]; |
|
|
|
var pointer = (EGID*) blocks.selectedBlocks.ToPointer(); |
|
|
|
var ret = new Block[blocks.count]; |
|
|
|
for (int j = 0; j < blocks.count; j++) |
|
|
|
{ |
|
|
|
var egid = pointer[j]; |
|
|
|
ret[j] = new Block(egid); |
|
|
|
} |
|
|
|
|
|
|
|
return ret; |
|
|
|
} |
|
|
|
} |
|
|
|
} |