void Distribute(LocationDeck deck) { int p = 0; for (int idx = (players * 7) - 1; idx >= 0; --idx) { deck.MoveTo(idx, world.cities[p].hand); p = (p + 1) % players; } for (int idx = deck.Count - 1; idx >= 0; --idx) { deck.MoveTo(idx, discards[age - 1]); } }
void Start() { handWidth = handTransform.GetComponent <RectTransform>().rect.width - GameController.instance.locationCardPrefab.GetComponent <RectTransform>().rect.width; currentDeck = startingDeck; for (int cLoop = 0; cLoop < currentDeck.cards.Count; cLoop++) { GameObject newCard = GameObject.Instantiate(GameController.instance.locationCardPrefab, handTransform); LocationCardSceneObj c = newCard.GetComponent <LocationCardSceneObj>(); RectTransform rt = c.GetComponent <RectTransform>(); rt.position = startTransform.position; c.GetComponent <LocationCardSceneObj>().SetupCard(currentDeck.cards[cLoop]); cards.Add(c); c.SetHand(this); } UpdateDeckSizes(); }
public void AddLocation(string location) { LocationDeck.AddCardTop(location); }