public void StartGame() { //Initialize the deck controller DeckMng = GetComponent<DeckManager>(); if (DeckMng == null) DeckMng = gameObject.AddComponent<DeckManager>(); DeckMng.Init(); //Initialize the move controller MoveCtrl = GetComponent<MovesController>(); if (MoveCtrl == null) MoveCtrl = gameObject.AddComponent<MovesController>(); MoveCtrl.Init(); //Initialize the interface controller InterfaceCtrl = FindObjectOfType<InterfaceController>(); InterfaceCtrl.Init(); //Initialize the MoveController with the avaiable decks List<DeckController> decks = new List<DeckController>(); decks.Add(DeckMng.DeckDrawnCards); decks.AddRange(DeckMng.DecksColumn); decks.AddRange(DeckMng.DecksSeed); MovesCalculator.Init(decks); }
/// <summary> /// Display a hint if avaiable /// </summary> public void ShowHint() { MovesController.Move moveToShow = MovesCalculator.GetHint(); if (moveToShow == null) { if (GameManager.I.DeckMng.DeckMain.GetTopCard() == null) { DisplayDefeatMenu(); } return; } moveToShow.Card.BlinkForHint(); //Also show destination... maybe too much int //CardBehaviour otherCard = moveToShow.EndingDeck.GetTopCard(); //if(otherCard != null) // otherCard.BlinkForHint(); }