Ejemplo n.º 1
0
 protected Room(RoomId roomId, RoomCode roomCode, RoomPlayer host)
 {
     RoomId   = roomId;
     RoomCode = roomCode;
     Host     = host;
     Status   = RoomStatus.Waiting;
 }
Ejemplo n.º 2
0
 public RoomCreatedEvent(RoomId roomId, RoomCode roomCode, PlayerId hostPlayerId, CharacterKey hostCharacterKey)
 {
     RoomId           = roomId;
     RoomCode         = roomCode;
     HostPlayerId     = hostPlayerId;
     HostCharacterKey = hostCharacterKey;
 }
Ejemplo n.º 3
0
        public static Room CreateRoom(PlayerId hostPlayerId, string hostUserName, CharacterKey characterKey)
        {
            var room = new Room(RoomId.NewRoomId(), RoomCode.NewRoomCode(), new RoomPlayer(hostPlayerId, hostUserName, characterKey, 0));

            room.AddDomainEvent(new RoomCreatedEvent(room.RoomId, room.RoomCode, hostPlayerId, characterKey));

            return(room);
        }
Ejemplo n.º 4
0
        public static bool TryParse(string value, out RoomCode output, out string error)
        {
            output = null;
            if (IsInvalid(value, out error))
            {
                return(false);
            }

            output = new RoomCode(value);

            return(true);
        }
Ejemplo n.º 5
0
 public bool Equals(RoomCode b)
 {
     return(b != null && this._value == b._value);
 }