Created
January 26, 2019 12:11
-
-
Save zonaryFUND/e6283a71bea8796dfa132ff637a0a53d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Linq; | |
using Monad; | |
using Monad.Extensions; | |
namespace BuildCiv.Model.CardDifinition | |
{ | |
public readonly struct Barter : IPlayable | |
{ | |
public int CivilCost => 1; | |
public bool IsPlayable(ITable table) | |
=> table.Hand.Cards.Count() > 0; | |
ContState<ITable, Unit> IPlayable.Play() | |
=> | |
from _dispose in ( | |
from disposed in HandEffect.RequestSelection(1) | |
from _ in HandEffect.Dispose(disposed).Lift() | |
select _ | |
).ToTable() | |
from _draw in ( | |
from drawed in TableEffect.Draw(2) | |
from _ in HandEffect.Add(drawed).ToTable() | |
select _ | |
).Lift() | |
select Unit.Default; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment