Class InMemoryServerCollection

java.lang.Object
crow.game.omnisrv.InMemoryServerCollection
All Implemented Interfaces:
ServerCollection

public class InMemoryServerCollection extends Object implements ServerCollection
In-memory implementation of ServerCollection, responsible for keeping track of known servers.
  • Constructor Details

    • InMemoryServerCollection

      public InMemoryServerCollection()
  • Method Details

    • all

      public Set<CharServer> all()
      Specified by:
      all in interface ServerCollection
      Returns:
      a read-only view of all the kwown servers.
    • add

      public void add(CharServer srv)
      Specified by:
      add in interface ServerCollection
      Parameters:
      srv - A new server to add to our known servers.
    • removeByName

      public void removeByName(String name)
      Description copied from interface: ServerCollection
      Remove a server, given the name of the servers.
      Specified by:
      removeByName in interface ServerCollection
      Parameters:
      name - The name of the server
    • setCount

      public void setCount(String name, int count)
      Description copied from interface: ServerCollection
      Set the user count for the given server name
      Specified by:
      setCount in interface ServerCollection
      Parameters:
      name - The name of the server
      count - The amount of users.