Broke Protocol Game API Reference  1.39
Code reference for server and client scripting
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
BrokeProtocol.Entities.ShVoxel Class Reference
Inheritance diagram for BrokeProtocol.Entities.ShVoxel:
BrokeProtocol.Entities.ShDamageable BrokeProtocol.Entities.ShEntity BrokeProtocol.Entities.Serialized BrokeProtocol.Entities.ShSmoothVoxel

Public Member Functions

override void InitializeEditor ()
 
void AddSphere (Vector3 position, float radius, byte data)
 
void DamageSphere (Vector3 position, float radius, float damage)
 
int3 GetHitPoint (Vector3 hitPoint, Vector3 hitNormal, float offset)
 
void CreateMesh (byte[] data=null, Color32[] paletteReplacement=null)
 
bool InBounds (int3 gridPos)
 
byte GetVoxel (int3 localPos)
 
void AddVoxels (IEnumerable<(int3, byte)> data)
 
void RemoveVoxels (IEnumerable< int3 > gridPositions)
 
void DamageVoxels (IEnumerable< int3 > gridPositions, float damage)
 
List<(int3, byte)> GetSphere (int3 gridPos, float radius, byte type)
 
virtual List< int3 > GetSphere (int3 gridPos, float radius)
 
- Public Member Functions inherited from BrokeProtocol.Entities.ShDamageable
virtual void HitEffect (Collider collider, DamageIndex damageIndex, Vector3 point, Vector3 normal)
 
- Public Member Functions inherited from BrokeProtocol.Entities.ShEntity
Bounds GetWorldBounds ()
 
virtual void CleanUp ()
 
virtual void Restore (Vector3 position, Quaternion rotation, Transform placeT)
 
override void CheckSave ()
 
float GetLocalY (Vector3 worldPosition)
 
float GetFlatAngle (Vector3 v)
 
virtual bool InActionRange (ShEntity e)
 
bool CanSeeEntity (ShEntity other, bool checkInFront=false, float viewRange=Util.visibleRange)
 
bool GetOverlapEntity< T > (Vector3 position, Quaternion rotation, int maskIndex, float extentsMultiplier, Predicate< T > predicate, out T entity)
 
bool CanSpawn (Vector3 position, Quaternion rotation, ShEntity[] ignoreArray)
 
bool CanSee (Vector3 position)
 
float Distance (ShEntity other)
 
float DistanceSqr (ShEntity other)
 
float DistanceSqr2D (ShEntity other)
 
float DistanceSqr2D (Vector3 other)
 
float Distance (Vector3 other)
 
float DistanceSqr (Vector3 other)
 
virtual void DestroyExtras ()
 
void SetParent (Transform parent)
 
void SetPosition (Vector3 position)
 
virtual void SetRotation (Quaternion rotation)
 
void SetPositionSafe (Vector3 targetPosition)
 
virtual void Destroy ()
 
virtual void PreInitialize (int ID)
 
virtual void Initialize ()
 
virtual void Spawn (Vector3 position, Quaternion rotation, Transform placeT)
 
void DeactivateEntity ()
 
void IgnoreCollision (ShPlayer p, bool ignore)
 
IEnumerator ResetCollisions (ShPlayer p)
 
virtual void SetTransform (Vector3 position, Quaternion rotation, bool zeroVelocity)
 
int InventoryValue ()
 
int GetMyItemValue (ShItem item, bool markup)
 
void SendViewerDelta (byte delta, int itemIndex, int amount, ShPlayer ignorePlayer)
 
void TransferMoney (byte deltaType, int amount=1, bool dispatch=true)
 
void TransferItem (byte deltaType, ShItem item, int amount=1, bool dispatch=true)
 
bool ValidTransfer (int itemIndex, int amount)
 
virtual void TransferItem (byte deltaType, int itemIndex, int amount=1, bool dispatch=true)
 
byte[] SerializeMyItems ()
 
SizedArray SerializeShop ()
 
void DeserializeMyItems (byte[] inventoryArray)
 
void DeserializeShop (byte[] inventoryArray)
 
virtual void AddToMyItems (int itemIndex, int amount, bool dispatch)
 
void AddToTradeItems (int itemIndex, int amount)
 
virtual void RemoveFromMyItems (int itemIndex, int amount, bool dispatch)
 
void RemoveFromTradeItems (int itemIndex, int amount)
 
virtual bool CanBeSearched (ShPlayer p)
 
bool CanBeCracked (ShPlayer p)
 
int ItemCount (Dictionary< int, InventoryItem > inventory, int itemIndex)
 
bool HasItem (ShItem item)
 
bool HasItem (int itemIndex)
 
int MyItemCount (ShEntity item)
 
int TradeItemCount (ShEntity item)
 
int MyItemCount (int itemIndex)
 
int TradeItemCount (int itemIndex)
 
void ClearAllViewers ()
 
void RemoveViewer (ShPlayer viewer)
 
bool ShopCanBuy (ShItem item)
 
- Public Member Functions inherited from BrokeProtocol.Entities.Serialized
virtual void BoundsHighlightAdd ()
 
virtual void BoundsHighlightRemove ()
 
void Trigger (Collider collider, string eventName, bool enter)
 

Static Public Member Functions

static Vector3 ToVector3 (int3 v)
 
static int3 ToInt3 (Vector3 v)
 
static int To1DIndex (int3 gridPos, int3 chunkSize)
 

Public Attributes

Material material
 
float hitPoints = -1f
 
float regenDelay = -1f
 
int regenRate = -1
 
byte[] voxelData
 
NativeArray< Color32 > palette
 
byte[] voxels
 
int3 min
 
int3 max
 
int3 size
 
- Public Attributes inherited from BrokeProtocol.Entities.ShDamageable
SvDamageable svDamageable
 
- Public Attributes inherited from BrokeProtocol.Entities.ShEntity
ClEntity clEntity
 
SvEntity svEntity
 
Animator animator
 
bool syncAnimator
 
ShPlayer controller
 
Dictionary< string, string > dynamicActions = new ()
 
bool isHuman
 
float videoStartTime
 
string profile = string.Empty
 
bool isWorldEntity
 
Renderer[] renderers
 
AppIndex[] availableApps
 
InventoryType inventoryType
 
Dictionary< int, InventoryItemmyItems = new ()
 
Dictionary< int, InventoryItemtradeItems = new ()
 
HashSet< ShPlayerviewers = new ()
 
HashSet< Collider > colliders
 
int ID
 
int index
 
ShManager manager
 
int value
 
int respawnFrame
 
Vector3 relativeVelocity
 
Bounds bounds
 
- Public Attributes inherited from BrokeProtocol.Entities.Serialized
string referencePrefab
 
GameObject go
 
Transform mainT
 
string data
 
BoundsHighlight highlight
 

Static Public Attributes

const int paletteSize = byte.MaxValue + 1
 
static int updateCounter
 

Protected Member Functions

void OnDestroy ()
 
void Start ()
 
virtual void Update ()
 
- Protected Member Functions inherited from BrokeProtocol.Entities.ShEntity
virtual void UpdateMainColliders ()
 
InventoryItem DeserializeItem (byte[] itemArray)
 
InventoryItem DeserializeShopItem (byte[] itemArray)
 
void AddToInventory (Dictionary< int, InventoryItem > inventory, int itemIndex, int amount)
 
void RemoveFromInventory (Dictionary< int, InventoryItem > inventory, int itemIndex, int amount)
 

Protected Attributes

ParticleSystem particleSpawner
 
Transform particleTransform
 

Properties

override SerializedParameters Parameters [get]
 
override Type EditorType [get]
 
static byte GetRandomType [get]
 
virtual string ChunkPrefabName [get]
 
virtual int Smoothing [get]
 
- Properties inherited from BrokeProtocol.Entities.ShEntity
virtual bool IsDead [get]
 
virtual bool SyncTransform [get]
 
virtual Collider Ground [get]
 
virtual ShEntity SpecEntity [get]
 
bool SpecSelf [get]
 
override SerializedParameters Parameters [get]
 
override Type EditorType [get]
 
virtual ShMountable GetMount [get]
 
virtual ShPlayer Player [get]
 
virtual Vector3 Velocity [get, set]
 
virtual Vector3 GetOrigin [get]
 
virtual float MountHealth [get]
 
override bool SendInitial [get]
 
virtual InventoryStruct[] CollectedItems [get]
 
bool IsClientMain [get]
 
virtual float ProcessDuration [get]
 
Bounds ScaledBounds [get]
 
Vector3 CenterBounds [get]
 
bool HasInventory [get]
 
bool Shop [get]
 
int MyMoneyCount [get]
 
int TradeMoneyCount [get]
 
- Properties inherited from BrokeProtocol.Entities.Serialized
virtual bool SendInitial [get]
 
virtual SerializedParameters Parameters [get]
 
virtual Type EditorType [get]
 
ChildIndex GetChildIndex [get]
 
virtual Transform GetRotationT [get]
 
virtual Quaternion GetRotation [get]
 
Transform GetParent [get]
 
bool IsOutside [get]
 
int GetPlaceIndex [get]
 
Place GetPlace [get]
 
Vector3 GetPosition [get]
 
string LogPosition [get]
 
virtual Vector3 CenterBuoyancy [get]
 
virtual bool InWater [get]
 

Member Function Documentation

◆ AddSphere()

void BrokeProtocol.Entities.ShVoxel.AddSphere ( Vector3 position,
float radius,
byte data )

◆ AddVoxels()

void BrokeProtocol.Entities.ShVoxel.AddVoxels ( IEnumerable<(int3, byte)> data)
inline

◆ CreateMesh()

void BrokeProtocol.Entities.ShVoxel.CreateMesh ( byte[] data = null,
Color32[] paletteReplacement = null )
inline

◆ DamageSphere()

void BrokeProtocol.Entities.ShVoxel.DamageSphere ( Vector3 position,
float radius,
float damage )

◆ DamageVoxels()

void BrokeProtocol.Entities.ShVoxel.DamageVoxels ( IEnumerable< int3 > gridPositions,
float damage )
inline

◆ GetHitPoint()

int3 BrokeProtocol.Entities.ShVoxel.GetHitPoint ( Vector3 hitPoint,
Vector3 hitNormal,
float offset )
inline

◆ GetSphere() [1/2]

virtual List< int3 > BrokeProtocol.Entities.ShVoxel.GetSphere ( int3 gridPos,
float radius )
inlinevirtual

◆ GetSphere() [2/2]

List<(int3, byte)> BrokeProtocol.Entities.ShVoxel.GetSphere ( int3 gridPos,
float radius,
byte type )
inline

◆ GetVoxel()

byte BrokeProtocol.Entities.ShVoxel.GetVoxel ( int3 localPos)

◆ InBounds()

bool BrokeProtocol.Entities.ShVoxel.InBounds ( int3 gridPos)

◆ InitializeEditor()

override void BrokeProtocol.Entities.ShVoxel.InitializeEditor ( )
virtual

Reimplemented from BrokeProtocol.Entities.Serialized.

◆ OnDestroy()

void BrokeProtocol.Entities.ShVoxel.OnDestroy ( )
protected

◆ RemoveVoxels()

void BrokeProtocol.Entities.ShVoxel.RemoveVoxels ( IEnumerable< int3 > gridPositions)
inline

◆ Start()

void BrokeProtocol.Entities.ShVoxel.Start ( )
inlineprotected

◆ To1DIndex()

static int BrokeProtocol.Entities.ShVoxel.To1DIndex ( int3 gridPos,
int3 chunkSize )
static

◆ ToInt3()

static int3 BrokeProtocol.Entities.ShVoxel.ToInt3 ( Vector3 v)
static

◆ ToVector3()

static Vector3 BrokeProtocol.Entities.ShVoxel.ToVector3 ( int3 v)
static

◆ Update()

virtual void BrokeProtocol.Entities.ShVoxel.Update ( )
inlineprotectedvirtual

Member Data Documentation

◆ hitPoints

float BrokeProtocol.Entities.ShVoxel.hitPoints = -1f

◆ material

Material BrokeProtocol.Entities.ShVoxel.material

◆ max

int3 BrokeProtocol.Entities.ShVoxel.max

◆ min

int3 BrokeProtocol.Entities.ShVoxel.min

◆ palette

NativeArray<Color32> BrokeProtocol.Entities.ShVoxel.palette

◆ paletteSize

const int BrokeProtocol.Entities.ShVoxel.paletteSize = byte.MaxValue + 1
static

◆ particleSpawner

ParticleSystem BrokeProtocol.Entities.ShVoxel.particleSpawner
protected

◆ particleTransform

Transform BrokeProtocol.Entities.ShVoxel.particleTransform
protected

◆ regenDelay

float BrokeProtocol.Entities.ShVoxel.regenDelay = -1f

◆ regenRate

int BrokeProtocol.Entities.ShVoxel.regenRate = -1

◆ size

int3 BrokeProtocol.Entities.ShVoxel.size

◆ updateCounter

int BrokeProtocol.Entities.ShVoxel.updateCounter
static

◆ voxelData

byte [] BrokeProtocol.Entities.ShVoxel.voxelData

◆ voxels

byte [] BrokeProtocol.Entities.ShVoxel.voxels

Property Documentation

◆ ChunkPrefabName

virtual string BrokeProtocol.Entities.ShVoxel.ChunkPrefabName
get

◆ EditorType

override Type BrokeProtocol.Entities.ShVoxel.EditorType
get

◆ GetRandomType

byte BrokeProtocol.Entities.ShVoxel.GetRandomType
staticget

◆ Parameters

override SerializedParameters BrokeProtocol.Entities.ShVoxel.Parameters
get

◆ Smoothing

virtual int BrokeProtocol.Entities.ShVoxel.Smoothing
get

The documentation for this class was generated from the following file: