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.

49 lines
1.3 KiB

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public abstract class ActiveBlock : Block
  5. {
  6. #region Read-Only Variables
  7. public bool isFinished { get; protected set; }
  8. #endregion Read-Only Variables
  9. #region Class Functions
  10. /// <summary>
  11. /// Is called after all players have taken one move
  12. ///
  13. /// Should be implemented by a derived class
  14. /// </summary>
  15. public virtual IEnumerator OnEnvironmentTurn(PlayerData[] allPlayers)
  16. {
  17. isFinished = true;
  18. yield break;
  19. }
  20. /// <summary>
  21. /// Called after all players have finished all their moves
  22. ///
  23. /// Should be implemented by a derived class
  24. /// </summary>
  25. public virtual IEnumerator OnRoundEnd(PlayerData[] allPlayers)
  26. {
  27. isFinished = true;
  28. yield break;
  29. }
  30. public void Reset()
  31. {
  32. isFinished = false;
  33. }
  34. /// <summary>
  35. /// Returns what order this block should be called in for the environment turn;
  36. /// </summary>
  37. /// <returns>The Higher the number returned the earlier it goes</returns>
  38. /// <remarks>This was made abstract because it shouldn't be accidentally changed + so we don;t accidentally forget to implement it</remarks>
  39. public abstract int GetInitative();
  40. #endregion Class Functions
  41. }