Address feedback from @hakusaro about style & documentation
This commit is contained in:
parent
658c714ac5
commit
817dfe26fc
3 changed files with 40 additions and 18 deletions
|
|
@ -42,10 +42,29 @@ namespace TShockAPI.Net
|
|||
public bool IsActuator { get; set; }
|
||||
public byte TileColor { get; set; }
|
||||
public byte WallColor { get; set; }
|
||||
public bool Slope { get; set; }
|
||||
public bool Slope1 { get; set; }
|
||||
public bool Slope2 { get; set; }
|
||||
public bool Slope3 { get; set; }
|
||||
|
||||
public byte Slope
|
||||
{
|
||||
get
|
||||
{
|
||||
byte sl = 0;
|
||||
|
||||
if (Slope1)
|
||||
sl += 1;
|
||||
|
||||
if (Slope2)
|
||||
sl += 2;
|
||||
|
||||
if (Slope3)
|
||||
sl += 4;
|
||||
|
||||
return sl;
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasColor
|
||||
{
|
||||
get { return TileColor > 0; }
|
||||
|
|
@ -87,8 +106,9 @@ namespace TShockAPI.Net
|
|||
TileColor = 0;
|
||||
WallColor = 0;
|
||||
Lighted = false;
|
||||
Slope = false;
|
||||
Slope1 = false;
|
||||
Slope2 = false;
|
||||
Slope3 = false;
|
||||
}
|
||||
|
||||
public NetTile(Stream stream)
|
||||
|
|
@ -120,9 +140,7 @@ namespace TShockAPI.Net
|
|||
bits[6] = true;
|
||||
|
||||
if (Inactive)
|
||||
{
|
||||
bits[7] = true;
|
||||
}
|
||||
|
||||
stream.WriteInt8((byte) bits);
|
||||
|
||||
|
|
@ -140,7 +158,7 @@ namespace TShockAPI.Net
|
|||
if (HasWallColor)
|
||||
bits[3] = true;
|
||||
|
||||
if (Slope)
|
||||
if (Slope1)
|
||||
bits[4] = true;
|
||||
|
||||
if (Slope2)
|
||||
|
|
@ -191,7 +209,7 @@ namespace TShockAPI.Net
|
|||
|
||||
Wire2 = flags2[0];
|
||||
Wire3 = flags2[1];
|
||||
Slope = flags2[4];
|
||||
Slope1 = flags2[4];
|
||||
Slope2 = flags2[5];
|
||||
Slope3 = flags2[6];
|
||||
Wire4 = flags2[7];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue