public static remote.PokerAction ToRemote(this remote.PokerAction rm, metagame.PokerAction o) { rm.Kind = _AkToRemote[o.Kind]; rm.Position = o.Position; rm.Amount = o.Amount; rm.Cards = o.Cards; return(rm); }
public void Test_PokerAction() { metagame.PokerAction o1 = metagame.PokerAction.c(0, -15.3); metagame.PokerAction o2 = null; remote.PokerAction rm1 = new remote.PokerAction(); rm1.ToRemote(o1); using (MemoryStream s = new MemoryStream()) { Serializer.Serialize(s, rm1); s.Seek(0, SeekOrigin.Begin); remote.PokerAction rm2 = Serializer.Deserialize <remote.PokerAction>(s); o2 = rm2.FromRemote(); } Assert.IsNotNull(o2); Assert.AreEqual(o1, o2); }
public static metagame.PokerAction FromRemote(this remote.PokerAction rm) { metagame.PokerAction o = new metagame.PokerAction(_AkFromRemote[rm.Kind], rm.Position, rm.Amount, rm.Cards); return(o); }