You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.3 KiB

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class ActiveBlock : Block
  5. {
  6. protected List<PlayerData> currentPlayers = new List<PlayerData>();
  7. #region Class Functions
  8. /// <summary>
  9. /// Is called after all players have taken one move
  10. ///
  11. /// Should be implemented by a derived class
  12. /// </summary>
  13. public virtual void OnEnvironmentTurn(PlayerData[] allPlayers)
  14. {
  15. }
  16. /// <summary>
  17. /// Is called when a player moves onto this block
  18. ///
  19. /// Should be implemented by a derived class
  20. /// </summary>
  21. /// <param name="player">Player which moved on to block</param>
  22. public virtual void OnWalkedOnByPlayer(PlayerData player)
  23. {
  24. currentPlayers.Add(player);
  25. }
  26. /// <summary>
  27. /// Is called when a player moves off of block
  28. ///
  29. /// Should be implemented by a derived class
  30. /// </summary>
  31. /// <param name="player">Player which moved on to block</param>
  32. public virtual void OnLeftByPlayer(PlayerData player)
  33. {
  34. currentPlayers.Remove(player);
  35. }
  36. /// <summary>
  37. /// Called after all players have finished all their moves
  38. ///
  39. /// Should be implemented by a derived class
  40. /// </summary>
  41. public virtual void OnRoundEnd(PlayerData[] allPlayers)
  42. {
  43. }
  44. #endregion Class Functions
  45. }