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.
116 lines
3.3 KiB
116 lines
3.3 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using TheGameExtreme.model.gameActions;
|
|
|
|
namespace TheGameExtreme.model.gameActions.classic
|
|
{
|
|
public class GameMode
|
|
{
|
|
|
|
protected List<GameAction> gameActions;
|
|
|
|
public GameMode()
|
|
{
|
|
gameActions = new List<GameAction>();
|
|
|
|
gameActions.Add(new Piocher());
|
|
gameActions.Add(new JouerUneCarte());
|
|
gameActions.Add(new TerminerSonTour());
|
|
}
|
|
|
|
public void pioche()
|
|
{
|
|
((Piocher)gameActions[0]).pioche();
|
|
}
|
|
|
|
public void playCard()
|
|
{
|
|
((JouerUneCarte)gameActions[0]).play();
|
|
}
|
|
|
|
public void endTurn()
|
|
{
|
|
((TerminerSonTour)gameActions[0]).end();
|
|
}
|
|
|
|
|
|
// private List<Rule> playRule = new List<Rule>();
|
|
// private List<Rule> beforeEndTurnRule = new List<Rule>();
|
|
// private List<Rule> endTurnRule = new List<Rule>();
|
|
// private List<Rule> commonRule = new List<Rule>();
|
|
|
|
// public GameMode()
|
|
// {
|
|
// }
|
|
|
|
// public void addPlayRule(PlayRule rule)
|
|
// {
|
|
// playRule?.Add(rule);
|
|
// }
|
|
|
|
// public void addEndTurnRule(EndTurnRule rule)
|
|
// {
|
|
// endTurnRule?.Add(rule);
|
|
// }
|
|
|
|
// public void addBeforeEndTurnRule(BeforeEndTurnRule rule)
|
|
// {
|
|
// beforeEndTurnRule?.Add(rule);
|
|
// }
|
|
|
|
// public void addCommonRule(Rule rule)
|
|
// {
|
|
// // Vérifier que se ne soit ni une PlayRule, ni une EndTurnRule ?
|
|
// commonRule?.Add(rule);
|
|
// }
|
|
|
|
// public bool checkPlayRule(Card card, Stack<Card> orderedStack, bool bottomUp, List<Card> CurrentHand)
|
|
// {
|
|
// foreach(PlayRule rule in playRule)
|
|
// {
|
|
// if (rule.Test(card, orderedStack, bottomUp, CurrentHand)) // Gestion des messages pour savoir qu'elle règle n'est pas respecter.
|
|
// {
|
|
// return true;
|
|
// }
|
|
// }
|
|
// foreach (Rule rule in commonRule)
|
|
// {
|
|
|
|
// }
|
|
// return false;
|
|
// }
|
|
|
|
// public bool checkBeforeEndTurnRule(List<Card> CurrentCardPlayed, int nbCardAtBeginOfTurn, List<Card> CurrentHand)
|
|
// {
|
|
// foreach (BeforeEndTurnRule rule in beforeEndTurnRule)
|
|
// {
|
|
// if (!rule.Test(CurrentCardPlayed, nbCardAtBeginOfTurn, CurrentHand)) // Gestion des messages pour savoir qu'elle règle n'est pas respecter.
|
|
// {
|
|
// return false;
|
|
// }
|
|
// }
|
|
// foreach (Rule rule in commonRule)
|
|
// {
|
|
|
|
// }
|
|
// return true;
|
|
// }
|
|
|
|
// public bool checkEndTurnRule(List<Card> CurrentCardPlayed, int nbCardAtBeginOfTurn, List<Card> CurrentHand)
|
|
// {
|
|
// foreach (EndTurnRule rule in endTurnRule)
|
|
// {
|
|
// if (!rule.Test(CurrentCardPlayed, nbCardAtBeginOfTurn, CurrentHand)) // Gestion des messages pour savoir qu'elle règle n'est pas respecter.
|
|
// {
|
|
// return false;
|
|
// }
|
|
// }
|
|
// foreach (Rule rule in commonRule)
|
|
// {
|
|
|
|
// }
|
|
// return true;
|
|
// }
|
|
//}
|
|
}
|