Create TurnIntentions

This commit is contained in:
henriquenakashima 2020-09-30 23:56:59 -04:00
parent 838c30af99
commit 94b3309bb7
9 changed files with 181 additions and 32 deletions

View file

@ -3,6 +3,13 @@ using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public enum PlayableState {
Unplayable,
Playable,
IntendedToPlay,
}
public class CardUI : MonoBehaviour
{
public Text nameText;
@ -55,11 +62,21 @@ public class CardUI : MonoBehaviour
}
public bool Playable {
public PlayableState State {
set {
if (!this.hidden) {
this.GetComponent<Image>().color = value ? Color.white : Color.grey;
this.artImage.color = value ? Color.white : Color.grey;
if (this.hidden) return;
if (value == PlayableState.Unplayable) {
this.GetComponent<Image>().color = Color.grey;
this.artImage.color = Color.grey;
} else if (value == PlayableState.Playable) {
this.GetComponent<Image>().color = Color.white;
this.artImage.color = Color.white;
} else if (value == PlayableState.IntendedToPlay) {
this.GetComponent<Image>().color = Color.yellow;
this.artImage.color = Color.yellow;
} else {
throw new System.ArgumentException("Unknown PlayableState " + value);
}
}
}