Power - spotřebovává se když jsou zavřené dveře. Hráči mohou zavírat pouze dveře na svojí polovině mapy. Oprava bugu v MovementOpportunity, který způsoboval zpožďování intervalu.
This commit is contained in:
parent
7656707177
commit
25a62af483
22 changed files with 240 additions and 59 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices.JavaScript;
|
||||
using GlobalClassLib;
|
||||
|
||||
|
|
@ -18,7 +19,7 @@ public class ClientMapManager {
|
|||
|
||||
for (int i = 0; i < 5; i++){
|
||||
for (int j = 0; j < 2; j++){
|
||||
map[i, j] = new MapTileProjection(CoordsToId(i, j)); // TODO: implement ownership
|
||||
map[i, j] = new MapTileProjection(CoordsToId(i, j));
|
||||
}
|
||||
map[i, 2] = new MapTileProjection(CoordsToId(i, 2));
|
||||
for (int j = 3; j < 5; j++){
|
||||
|
|
@ -26,8 +27,6 @@ public class ClientMapManager {
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static void InitConnectors(TileConnectorProjection[] connectors) {
|
||||
|
|
@ -42,6 +41,21 @@ public class ClientMapManager {
|
|||
|
||||
public static TileConnectorProjection[] GetConnectors(int tileId) => Get(IdToCoords(tileId)).GetAllConnectors();
|
||||
|
||||
public static TileConnectorProjection[] GetAllConnectors() {
|
||||
List<TileConnectorProjection> connectors = new();
|
||||
|
||||
for (int i = 0; i < 5; i++){
|
||||
for (int j = 0; j < 5; j++){
|
||||
MapTileProjection tile = map[i, j];
|
||||
Array.ForEach(tile.GetAllConnectors(), c => {
|
||||
if(tile.Id < c.OtherTile(tile).Id)
|
||||
connectors.Add(c);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return connectors.ToArray();
|
||||
}
|
||||
|
||||
|
||||
public const int ID_X_OFFSET = 5; // map grid height
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using GlobalClassLib;
|
|||
namespace FNAF_Clone.Map;
|
||||
|
||||
public class MapTileProjection : GlobalMapTile<TileConnectorProjection, MapTileProjection> {
|
||||
public ClientPlayer? Owner { get; set; }
|
||||
public MapTileProjection(int id) : base(id, ClientMapManager.IdToCoords(id)) {
|
||||
}
|
||||
}
|
||||
|
|
@ -3,11 +3,12 @@ using GlobalClassLib;
|
|||
namespace FNAF_Clone.Map;
|
||||
|
||||
public class TileConnectorProjection : GlobalTileConnector<MapTileProjection, TileConnectorProjection> {
|
||||
public ClientPlayer? Owner { get; set; }
|
||||
public TileConnectorProjection(MapTileProjection tile1, MapTileProjection tile2, ConnectorType type) : base(tile1, tile2, type) {
|
||||
}
|
||||
|
||||
public TileConnectorProjection(MapTileProjection tile2, ConnectorType type) : base(tile2, type) {
|
||||
}
|
||||
|
||||
public override TileConnectorProjection Clone() => new(Tiles.tile1, Tiles.tile2, Type);
|
||||
public override TileConnectorProjection Clone() => new(Tiles.tile1, Tiles.tile2, Type){Owner = Owner};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue