Remote dveře lze na mapě otevírat a zavírat. Office dveře hráče lze vidět na mapě (ukazují se ale pouze pro hráče 1). PlayerCommandy, které přepínají mezi dvěma stavy mají přidaný parametr state - client tudíž určuje jejich nový stav. Pokud se neshoduje stav v GameEventu se stavem odeslaným v Commandu, zobrazí se v konzoli varování. Client již nečeká na odpověď serveru při změně UI. Connectory se neklonují, oba tily používají stejnou instanci.
This commit is contained in:
parent
70b5debb22
commit
cea56112ea
14 changed files with 112 additions and 48 deletions
|
|
@ -16,11 +16,28 @@ public abstract class GlobalTileConnector<TTile, TCon> where TTile : GlobalMapTi
|
|||
}
|
||||
|
||||
public (TTile tile1, TTile tile2) Tiles;
|
||||
public bool Blocked { get; set; }
|
||||
|
||||
public (int, int) Id => (Tiles.tile1.Id, Tiles.tile2.Id);
|
||||
|
||||
public ConnectorType Type { get; set; }
|
||||
|
||||
public TTile OtherTile(TTile tile) => Tiles.Item1 == tile ? Tiles.Item2 : Tiles.Item1;
|
||||
|
||||
public Direction GetDirection(TTile tile) {
|
||||
if (tile != Tiles.tile1 && tile != Tiles.tile2) return Direction.NONE;
|
||||
|
||||
TTile other = OtherTile(tile);
|
||||
(int, int) dpos = (other.GridPosition.x - tile.GridPosition.x, other.GridPosition.y - tile.GridPosition.y);
|
||||
|
||||
switch (dpos){
|
||||
case (0, 1): return Direction.NORTH;
|
||||
case (1, 0): return Direction.EAST;
|
||||
case (0, -1): return Direction.SOUTH;
|
||||
case (-1, 0): return Direction.WEST;
|
||||
default: return Direction.NONE;
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString() => $"Con ({Tiles.Item1.PositionAsString} -> {Tiles.Item2.PositionAsString})";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue