Package edu.wisc.game.websocket

## Class WatchPlayer

- java.lang.Object
- - edu.wisc.game.websocket.WatchPlayer

-     public class WatchPlayer
      extends Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `WatchPlayer.PickEncoder` | See https://docs.oracle.com/javaee/7/tutorial/websocket007.htm or https://www.baeldung.com/java-websockets for documentation on encoders
    `static class` | `WatchPlayer.Ready` | Messages sent to a GUI client to tell it that something is ready for it, and it can make another /newEpisode or /display call
    `static class` | `WatchPlayer.ReadyEncoder` |
    `static class` | `WatchPlayer.WatchMessage` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `WatchPlayer()` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `end()` |
    `void` | `incoming​(String message)` | Expects
    `void` | `onError​(Throwable t)` |
    `static void` | `sendHimChat​(String pid, String s)` |
    `void` | `start​(jakarta.websocket.Session session)` |
    `static <T> void` | `tellAbout​(String pid, T msg)` | Methods handling important events during the game call this method to let watchers now about the most recent event
    `static void` | `tellHim​(String pid, WatchPlayer.Ready msg)` |
    `String` | `toString()` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### WatchPlayer

          public WatchPlayer()

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### start

          public void start​(jakarta.websocket.Session session)

    - #### end

          public void end()

    - #### incoming

          public void incoming​(String message)

      Expects

                  WATCH pid
                  IAM pid
                  CHAT text

    - #### onError

          public void onError​(Throwable t)
                       throws Throwable

      Throws:
        `Throwable`

    - #### tellAbout

          public static <T> void tellAbout​(String pid,
                                           T msg)

      Methods handling important events during the game call this method to let watchers now about the most recent event
      Parameters:
        `pid` - The sender's player ID. The message will be sent to everyone who is watching that player. (In a 2PG, that will be that player's partner, of course)

    - #### tellHim

          public static void tellHim​(String pid,
                                     WatchPlayer.Ready msg)

      Parameters:
        `pid` - The destination player ID

    - #### sendHimChat

          public static void sendHimChat​(String pid,
                                         String s)