コード例 #1
0
    public virtual PlayerProfileMessage PlayerProfile(PlayerProfile profile)
    {
        PlayerProfileMessage msg = new PlayerProfileMessage();

        msg.Profile = profile;

        return(msg);
    }
コード例 #2
0
 public void RegisterOnPlayerProfile(ListGameRecordsFor callback)
 {
     server.RegisterHandler(
         PlayerProfileMessage.Type,
         delegate(NetworkMessage netMsg) {
         PlayerProfileMessage msg = netMsg.ReadMessage <PlayerProfileMessage>();
         netMsg.conn.Send(
             GameRecordListMessage.Type,
             factory.GameRecordList(callback(msg.Profile))
             );
     }
         );
 }
コード例 #3
0
    public void TestItSendsAPlayerProfileCorrectly()
    {
        PlayerProfileMessage msg     = Substitute.For <PlayerProfileMessage>();
        PlayerProfile        profile = new PlayerProfile("jayden", Arg.Any <Color>());

        factoryMock.PlayerProfile(profile).Returns(msg);

        subject.SendPlayerProfile(profile);

        factoryMock.Received().PlayerProfile(profile);

        clientMock.Received().Send(
            PlayerProfileMessage.Type,
            msg
            );
    }