Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
BatteryElectricElement.cs
浏览该文件的文档.
1using Engine;
2
3namespace Game {
5 public BatteryElectricElement(SubsystemElectricity subsystemElectricity, CellFace cellFace) : base(subsystemElectricity, cellFace) { }
6
7 public override float GetOutputVoltage(int face) {
8 Point3 point = CellFaces[0].Point;
10 Terrain.ExtractData(SubsystemElectricity.SubsystemTerrain.Terrain.GetCellValue(point.X, point.Y, point.Z))
11 )
12 / 15f;
13 }
14
15 public override void OnNeighborBlockChanged(CellFace cellFace, int neighborX, int neighborY, int neighborZ) {
16 int cellValue = SubsystemElectricity.SubsystemTerrain.Terrain.GetCellValue(cellFace.X, cellFace.Y - 1, cellFace.Z);
18 if (!block.IsCollidable_(cellValue)
19 || block.IsNonAttachable(cellValue)) {
20 SubsystemElectricity.SubsystemTerrain.DestroyCell(
21 0,
22 cellFace.X,
23 cellFace.Y,
24 cellFace.Z,
25 0,
26 false,
27 false
28 );
29 }
30 }
31 }
32}
static int GetVoltageLevel(int data)
override float GetOutputVoltage(int face)
BatteryElectricElement(SubsystemElectricity subsystemElectricity, CellFace cellFace)
override void OnNeighborBlockChanged(CellFace cellFace, int neighborX, int neighborY, int neighborZ)
virtual bool IsNonAttachable(int value)
virtual bool IsCollidable_(int value)
SubsystemElectricity SubsystemElectricity
ElectricElement(SubsystemElectricity subsystemElectricity, IEnumerable< CellFace > cellFaces)
ReadOnlyList< CellFace > CellFaces
static int ExtractContents(int value)
static int ExtractData(int value)