Skip to content

Commit

Permalink
Merge branch 'menu_player' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
WonderWoman2020 committed Jan 22, 2023
2 parents b6fbe02 + 2287af2 commit 94e46c9
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,13 @@ public bool isFullHouse(CardsCollection Cards)//Full
}
}
}
//dopisane, żeby nie wywalało, nwm czy wystarczy w logice gry
if (i >= 5)
break;
if (Cards.Cards[i].Value == Cards.Cards[i + 1].Value)
{
counterPair += 1;
i += 1;
}
//dopisane, żeby nie wywalało, nwm czy wystarczy w logice gry
if (i >= 5)
break;
}
Expand Down Expand Up @@ -275,7 +273,6 @@ public bool isTwoPairs(CardsCollection Cards)
i += 1;
}

//dopisane, żeby nie wywalało, nwm czy wystarczy w logice gry
if (i >= 6)
break;
}
Expand Down
14 changes: 13 additions & 1 deletion UnityProject/PokerGame/Assets/Scenes/Table.unity
Original file line number Diff line number Diff line change
Expand Up @@ -6194,7 +6194,19 @@ MonoBehaviour:
m_CharacterLimit: 0
m_OnEndEdit:
m_PersistentCalls:
m_Calls: []
m_Calls:
- m_Target: {fileID: 1286288996}
m_TargetAssemblyTypeName: Table, Assembly-CSharp
m_MethodName: ReadInputBet
m_Mode: 0
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_OnSubmit:
m_PersistentCalls:
m_Calls: []
Expand Down
22 changes: 18 additions & 4 deletions UnityProject/PokerGame/Assets/Scripts/UserInterface/Table.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class Table : MonoBehaviour
private GameObject[] Players;
private Component[] Components
{ get; set; }

private string betFieldText;
// Start is called before the first frame update
void Start()
{
Expand All @@ -37,7 +37,7 @@ void Start()

this.Players = GameObject.FindGameObjectsWithTag("Player");
this.Components = Players[0].GetComponents(typeof(Component));
foreach(Component component in Components)
foreach (Component component in Components)
{
Debug.Log(component.ToString());
}
Expand All @@ -47,22 +47,36 @@ void Start()
// Update is called once per frame
void Update()
{


}
public void ReadInputBet(string inputBet)
{
if (inputBet.Length == 0)
{
this.betFieldText = null;
return;
}
this.betFieldText = inputBet;
Debug.Log(this.betFieldText);
}
public void OnCheckButton()
{
Debug.Log("Check");
MyGameManager.Instance.MainPlayer.Check();
}
public void OnAllInButton()
{
Debug.Log("All on");
Debug.Log("All in");
MyGameManager.Instance.MainPlayer.AllIn();
}
public void OnPassButton()
{
Debug.Log("Pass");
MyGameManager.Instance.MainPlayer.Fold();
}
public void OnBidButton()
{
Debug.Log("Bid");
MyGameManager.Instance.MainPlayer.Raise(Convert.ToInt32(this.betFieldText));
}
}

0 comments on commit 94e46c9

Please sign in to comment.