Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add onmove #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Game/AI/Executor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ public virtual void OnDraw(int player)
// Some AI need do something on draw
}

public virtual void OnMove()
{
// Some AI need do something on Move
}

public virtual IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, int hint, bool cancelable)
{
// For overriding
Expand Down
8 changes: 8 additions & 0 deletions Game/GameAI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ public void OnDraw(int player)
Executor.OnDraw(player);
}

/// <summary>
/// Called when move a card
/// </summary>
public void OnMove()
{
Executor.OnMove();
}

/// <summary>
/// Called when it's a new turn.
/// </summary>
Expand Down
1 change: 1 addition & 0 deletions Game/GameBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ private void OnMove(BinaryReader packet)
(CardLocation)previousLocation + " move to " + (CardLocation)currentLocation + ")");
}
}
_ai.OnMove();
}

private void OnSwap(BinaryReader packet)
Expand Down