private static void DestroyBarricade(BarricadeRegion region, ushort index) { ThreadUtil.assertIsGameThread(); var data = region.barricades[index]; var drop = region.drops[index]; OnBarricadeDestroyed?.Invoke(data, drop); }
private static void DestroyStructure(StructureRegion region, ushort index) { ThreadUtil.assertIsGameThread(); var data = region.structures[index]; var drop = region.drops[index]; OnStructureDestroyed?.Invoke(data, drop); }
/// <inheritdoc /> public override void UnsafeDestroy() { ThreadUtil.assertIsGameThread(); if (!StructureManager.tryGetInfo(Model, out var x, out var y, out var index, out var sRegion)) { return; } StructureManager.destroyStructure(sRegion, x, y, index, Vector3.zero); }
/// <inheritdoc /> public override void UnsafeDestroy() { ThreadUtil.assertIsGameThread(); if (!BarricadeManager.tryGetInfo(Model, out var x, out var y, out var plant, out var index, out var bRegion)) { return; } BarricadeManager.destroyBarricade(bRegion, x, y, plant, index); }
private static void AskTransformStructure(byte x, byte y, uint instanceID) { ThreadUtil.assertIsGameThread(); if (!StructureManager.tryGetRegion(x, y, out var region)) { return; } var index = region.structures.FindIndex(k => k.instanceID == instanceID); var data = region.structures[index]; var drop = region.drops[index]; OnStructureTransformed?.Invoke(data, drop); }
private static void AskTransformBarricade(byte x, byte y, ushort plant, uint instanceID) { ThreadUtil.assertIsGameThread(); if (!BarricadeManager.tryGetRegion(x, y, plant, out var region)) { return; } var index = region.barricades.FindIndex(k => k.instanceID == instanceID); var data = region.barricades[index]; var drop = region.drops[index]; OnBarricadeTransformed?.Invoke(data, drop); }
private static void TellTransformStructure(StructureManager __instance, CSteamID steamID, byte x, byte y, uint instanceID) { ThreadUtil.assertIsGameThread(); if (!__instance.channel.checkServer(steamID) || !StructureManager.tryGetRegion(x, y, out var region)) { return; } var index = region.structures.FindIndex(k => k.instanceID == instanceID); if (index < 0) { return; } var data = region.structures[index]; var drop = region.drops[index]; OnStructureTransformed?.Invoke(data, drop, CurrentTransformingPlayerId); }
internal static void DestroyStructure(StructureRegion region, ushort index) { ThreadUtil.assertIsGameThread(); OnBuildableDestroyed?.Invoke(region.drops[index].instanceID, true); }
internal static void DestroyBarricade(BarricadeRegion region, ushort index) { ThreadUtil.assertIsGameThread(); OnBuildableDestroyed?.Invoke(region.drops[index].instanceID, false); }
/// <inheritdoc /> public override void UnsafeHeal(ushort amount) { ThreadUtil.assertIsGameThread(); StructureManager.repair(Model, amount, 1); }
/// <inheritdoc /> public override void UnsafeDamage(ushort damage) { ThreadUtil.assertIsGameThread(); StructureManager.damage(Model, Vector3.zero, damage, 1, false, damageOrigin: EDamageOrigin.Unknown); }
/// <inheritdoc /> public override void UnsafeDamage(ushort damage) { ThreadUtil.assertIsGameThread(); BarricadeManager.damage(Model, damage, 1, false, damageOrigin: EDamageOrigin.Unknown); }