diff --git a/ChaoticCrates/Assets/Scenes/gameScene.unity b/ChaoticCrates/Assets/Scenes/gameScene.unity index fccda35f0fb23293ffcf92ce076ed1f82fbe58e3..5b29ebfaa2dae6dbbcac86f91f3a2c19ccbe0bb1 100644 Binary files a/ChaoticCrates/Assets/Scenes/gameScene.unity and b/ChaoticCrates/Assets/Scenes/gameScene.unity differ diff --git a/ChaoticCrates/Assets/Scripts/Logic/Managers/GameManager.cs b/ChaoticCrates/Assets/Scripts/Logic/Managers/GameManager.cs index aef538a749a4f542f2e8fb65b8307360ea89c0c4..ef75161f755a50df1e217a88f3339d3013bc9d22 100644 --- a/ChaoticCrates/Assets/Scripts/Logic/Managers/GameManager.cs +++ b/ChaoticCrates/Assets/Scripts/Logic/Managers/GameManager.cs @@ -177,7 +177,9 @@ namespace Logic.Managers } #endregion - + + #region Public methods + public override void OnNetworkSpawn() { if(!IsHost) return; @@ -199,8 +201,6 @@ namespace Logic.Managers base.OnNetworkSpawn(); } - - #region Public methods /// <summary> /// Update GameState and fire an event /// </summary> diff --git a/ChaoticCrates/Assets/Scripts/Logic/MapAndMovement/MapManager.cs b/ChaoticCrates/Assets/Scripts/Logic/MapAndMovement/MapManager.cs index bec40882758134c4ed601361325f50ab87694dc7..d95f04724cee733ca145b8293cf96e32c4261291 100644 --- a/ChaoticCrates/Assets/Scripts/Logic/MapAndMovement/MapManager.cs +++ b/ChaoticCrates/Assets/Scripts/Logic/MapAndMovement/MapManager.cs @@ -72,7 +72,7 @@ namespace Logic.MapAndMovement private void InitGame(Dictionary<ulong, KeyValuePair<string, string>> dict) { if(!IsHost) return; - mapSize = 2 + dict.Count / 2; + mapSize = Math.Min(2 + dict.Count / 2, 20); areaLight.transform.localScale = new Vector3(mapSize * 10, mapSize * 10, 1); StartCoroutine(MainCoroutineFlow(dict)); } @@ -304,6 +304,12 @@ namespace Logic.MapAndMovement } } + /// <summary> + /// Open a gate on the edge of the map + /// </summary> + /// <param name="side">Side number</param> + /// <param name="pos">Gate start position</param> + /// <param name="gateSize">Gate size</param> private void OpenGate(int side, int pos, int gateSize) { int x = 0, y = 0; @@ -348,6 +354,10 @@ namespace Logic.MapAndMovement } } + /// <summary> + /// Initialize tilemap edges + /// </summary> + /// <returns></returns> private IEnumerator InitTileMap() { Tilemap tilemap = tileMap.GetComponent<Tilemap>(); @@ -408,10 +418,7 @@ namespace Logic.MapAndMovement Tilemap tilemap = tileMap.GetComponent<Tilemap>(); tilemap.SetTile(new Vector3Int(x, y), tile == 0 ? exitTile : forbiddenTile); } - #endregion - - #region Public methods - + private IEnumerator HideSprite(Dictionary<ulong, KeyValuePair<string, string>> dict) { List<ulong> normalIds = new List<ulong>(); diff --git a/ChaoticCrates/Assets/Scripts/Logic/RobotAction/RobotAction.cs b/ChaoticCrates/Assets/Scripts/Logic/RobotAction/RobotAction.cs index d4310c5fe9d12df74d7131e3f149cabd9113cfd3..325fa4ec756fa377d51113d8f475ee701c1644f6 100644 --- a/ChaoticCrates/Assets/Scripts/Logic/RobotAction/RobotAction.cs +++ b/ChaoticCrates/Assets/Scripts/Logic/RobotAction/RobotAction.cs @@ -4,6 +4,9 @@ using System; namespace Logic.RobotAction { + /// <summary> + /// Abstract Robot Action class to inherit from + /// </summary> public abstract class RobotAction { public abstract void DoAction(); diff --git a/ChaoticCrates/Assets/Scripts/Logic/Tasks/TaskValidator.cs b/ChaoticCrates/Assets/Scripts/Logic/Tasks/TaskValidator.cs index 3a50c161bf7f790c9b3bcb14a0c224e05074e26b..d268d45038d9c96f5d9999a32b42e3a938a09091 100644 --- a/ChaoticCrates/Assets/Scripts/Logic/Tasks/TaskValidator.cs +++ b/ChaoticCrates/Assets/Scripts/Logic/Tasks/TaskValidator.cs @@ -5,6 +5,9 @@ using UnityEngine; namespace Logic.Tasks { + /// <summary> + /// Class for validating a pattern + /// </summary> public class TaskValidator { private readonly GameObject _playerObject; @@ -14,6 +17,9 @@ namespace Logic.Tasks _playerObject = playerObject; } + /// <summary> + /// Try to validate the pattern, if valid add points to the team and generate new task + /// </summary> public void TryValidate() { Vector3Int playerPos = Vector3Int.RoundToInt(_playerObject.transform.position);