Package hoverball

Class Team

java.lang.Object
hoverball.Hovlet
hoverball.Team
Direct Known Subclasses:
hoverball.team.Barbarians_.Barbarians, hoverball.team.CosmicFriends_.CosmicFriends, hoverball.team.DuckTales_.DuckTales, hoverball.team.FantasticThree_.FantasticThree, hoverball.team.LasMaquinaTeam_.LasMaquinaTeam, hoverball.team.LazyLosers_.LazyLosers, hoverball.team.TeamTotal_.TeamTotal, hoverball.team.TribalQueens_.TribalQueens, hoverball.team.TrioGaulois_.TrioGaulois

public class Team
extends Hovlet
The class Team allows to pool Java units together in a team.

For this, we use the interlacing hovlet structure: A team is a trivial hovlet that players have been added to as sub-hovlets. With a simple call of the team method connect(...) all players can connect simultaneously to the Simulator.

Beside this pooling function the class Team has three other attributes Version, Author and Comment by means of which its implementation can be characterized on the predefined hovlet display.


Example of a team:

import hoverball.*;
 
public class MyTeam extends Team
{
   public MyTeam ()
   {
      super("My Team");
 
      add(new MyUnit("One",0xFF8800));
      add(new MyUnit("Two",0xFF4400));
      add(new MyUnit("Three",0xFF0000));
   }
}
  • Field Summary

    Fields 
    Modifier and Type Field Description
    java.lang.String author
    Team author
    java.lang.String comment
    Team comment
    java.lang.String version
    Team version

    Fields inherited from class hoverball.Hovlet

    background, BANNER, foreground, hovlets, icon, main, menubar, parent, title
  • Constructor Summary

    Constructors 
    Constructor Description
    Team​(java.lang.String name)
    Opens a team.
    Team​(java.lang.String name, java.lang.String version, java.lang.String author, java.lang.String comment)
    Opens a team.
  • Method Summary

    Modifier and Type Method Description
    boolean add​(Hovlet hovlet)
    Adds a hovlet to the team.

    Methods inherited from class hoverball.Hovlet

    browse, close, connect, connecting, disconnect, disconnecting, locate, locate, show, status, title

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • version

      public final java.lang.String version
      Team version
    • author

      public final java.lang.String author
      Team author
    • comment

      public final java.lang.String comment
      Team comment
  • Constructor Details

    • Team

      public Team​(java.lang.String name)
      Opens a team.
      Parameters:
      name - team name
    • Team

      public Team​(java.lang.String name, java.lang.String version, java.lang.String author, java.lang.String comment)
      Opens a team.

      The display of the attributes Version, Author and Comment can be disabled by the value null.

      Parameters:
      name - team name
      version - version
      author - author
      comment - comment
  • Method Details

    • add

      public boolean add​(Hovlet hovlet)
      Adds a hovlet to the team.

      If the hovlet is a unit, its team name is set to the title of the team hovlet.

      Overrides:
      add in class Hovlet
      Parameters:
      hovlet - hovlet
      Returns:
      true, if connection succeeded