コード例 #1
0
 public static FriendshipState GetFriendshipStateBasedOnInfo(FriendshipStateInfo info)
 {
     switch (info.Action)
     {
         case FriendshipAction.Accept:
             return new FriendshipAcceptedState(info);
         case FriendshipAction.Cancel:
             return new FriendshipCancelledState(info);
         case FriendshipAction.Reject:
             return new FriendshipRejectedState(info);
         case FriendshipAction.Request:
             return new FriendshipRequestedState(info);
         default:
             return new FriendshipNewState(info);
     }
 }
コード例 #2
0
 public FriendshipRejectedState(FriendshipStateInfo info)
 {
     _lastReceiverKey = info.Sender.Key;
     _lastSenderKey = info.Receiver.Key;
     _lastAction = info.Action;
 }