Examples of Player


Examples of edu.umd.cs.piccolo.PLayer

  }

  @Override
  public void setBounds(int x, int y, int w, int h) {

    PLayer layer = getLayer();
    layer.setBounds(layer.getX(), layer.getY(), w, h);
    topWorld.setBounds(topWorld.getX(), topWorld.getY(), w, h);

    super.setBounds(x, y, w, h);
  }
View Full Code Here

Examples of edu.ups.gamedev.player.Player

  protected void buildPlayer() {
    // TODO abstract player and tank creation

    // create player and tank
    Tank playerTank = createTank(Tank.LIGHT_TANK);
    player = new Player("Player", playerTank);

    // attach everything
    root.attachChild(playerTank);

    playerTank.setLocalTranslation(10, 200, 10);
View Full Code Here

Examples of edu.villanova.studs.poker.transport.Player

     *        have cards or not as well as have folded or not
     */
    private void setPlayerCards( ArrayList<Player> pls ) {
        //Variables to store data in types used by the calc engine
        HoleCards cards;
        Player player;
       
        //Set the total players in the hand (folder or not)
        totalPlayers = pls.size();
       
        //Create the HoleCards array used by the engine
        playerCards = new HoleCards[ totalPlayers ];
       
        //Loop through each player in the ArrayList, create a HoleCards object
        //for them, set their cards & state then add to the prcessing array
        //used by the calc engine
        for ( int ii = 0; ii < totalPlayers; ii++ ) {
            //Get the next player from the list
            player = pls.get(ii);
           
            //Check if the player is active (cards in their hand)
            if ( player.isActive() ) {
                //The player is active, create a HoleCards class for them and
                //assign their cards using the data from the input
                cards = new HoleCards( new Card( player.getCard(0).getRank(),
                                                 player.getCard(0).getSuit() ),
                                       new Card( player.getCard(1).getRank(),
                                                 player.getCard(1).getSuit() ) );
               
                //Check if the player has folded
                if ( player.getFolded() )
                    //This defaults to false, so only set if they have folded
                    cards.setFolded( true );
                else
                    //Haven't folded, inc the # of active players
                    activePlayers++;
View Full Code Here

Examples of eg.triviaGameExample.Player

    this.playerName = playerName;
  }

  public boolean addPlayer() {
    theGame = StaticGame.theGame;
    Player thePlayer = theGame.addPlayer(playerName);
    return theGame.playerIsPlaying(thePlayer);
  }
View Full Code Here

Examples of entities.Player

    return newid;
  }
 
  public Player getNewPlayer(String playername) {
    int neweid = neweid();
    Player newPlayer = new Player(neweid, playername);
    entities.put(neweid, newPlayer);

    newPlayer.addObserver(this);

    return newPlayer;
  }
View Full Code Here

Examples of es.mahulo.battleship.model.Player

    GameConfig gameConfig = gameConfigDao.find(1L); //TODO DEFINE A TABLE DEFAULT CONFIGURATION
   
    List<Player> players = new ArrayList<Player>();
   
    Player player = new Player();
    player.setUser(user);
    player.setShips(new ArrayList<Ship>());
    player.setShots(new ArrayList<Shot>());
    player.setGame(game);
   
    players.add(player);

    game.setGameConfig(gameConfig);
    game.setStatus(GameStatus.StartUp);
View Full Code Here

Examples of example.chat.Player

    super(session, message);
  }

  @Override
  public void execute() {
    Player player = manager.getPlayer(message.getPlayerId());
    Player[] friends = player.getFriends();
    OutputMessage outMsg = MessageFactory.createSFriendListRsp(friends);
   
    player.putMessage(outMsg);
   
    player.flush();
   
  }
View Full Code Here

Examples of fm.ak.server.fragment.Player

      //SelfRow.beforeFirst();
      SelfRow.beforeFirst();
      SelfRow.next();
     
      pid = SelfRow.getInt("pid");
      p = new Player(SelfRow.getInt("pid"), SelfRow.getString("pname"), SelfRow.getInt("px"), SelfRow.getInt("py") );
      Bus.put(pid, this);
      System.out.println(sid+":pid: "+pid);
      Lever = ( Lever == 1 ) ? 0 : 1;
        }
        else r = "Kill Yourself";


    }
    else if ( Apart[0].equals("region") )
    {
        //Statement SelfRowsttmnt = server.sql.createStatement();
        //SelfRow = SelfSttmnt.executeQuery("SELECT * FROM player WHERE pip = '" + client.getRemoteSocketAddress() + "' ");
        //SelfRow.refreshRow();

        Statement TileStatement = Main.sql.createStatement();
        ResultSet TileRows;

        Statement PlayerStatement = Main.sql.createStatement();
        ResultSet PlayerRows;

        Statement RegionStatement = Main.sql.createStatement();
        ResultSet RegionRows;

        SelfRow.beforeFirst();
        SelfRow.next();


        String TileQuery = "SELECT * FROM tile "
        + "LEFT JOIN entity ON tile.tid = entity.eid "
        + "WHERE "
        + "tx >= " + ( SelfRow.getInt("px")-1 - ((w / 40) / 2) ) + " AND "
        + "tx <= " + ( SelfRow.getInt("px")+1 + ((w / 40) / 2) ) + " AND "
        + "ty >= " + ( SelfRow.getInt("py")-1 - ((h / 40) / 2) ) + " AND "
        + "ty <= " + ( SelfRow.getInt("py")+1 + ((h / 40) / 2) );

        String RegionQuery = "SELECT * FROM region WHERE "
        + "rsx >= " + ( SelfRow.getInt("px")-1 - ((w / 40) / 2) ) + " AND "
        + "rsy <= " + ( SelfRow.getInt("px")+1 + ((w / 40) / 2) ) + " AND "
        + "rex >= " + ( SelfRow.getInt("py")-1 - ((h / 40) / 2) ) + " AND "
        + "rey <= " + ( SelfRow.getInt("py")+1 + ((h / 40) / 2) );

        String PlayerQuery = "SELECT * FROM player WHERE "
        + " px >= " + ( SelfRow.getInt("px")-1 - ((w / 40) / 2) ) + " AND"
        + " px <= " + ( SelfRow.getInt("px")+1 + ((w / 40) / 2) ) + " AND"
        + " py >= " + ( SelfRow.getInt("py")-1 - ((h / 40) / 2) ) + " AND"
        + " py <= " + ( SelfRow.getInt("py")+1 + ((h / 40) / 2) ) + " AND pid != " + pid;

        PlayerRows = PlayerStatement.executeQuery(PlayerQuery);
        TileRows = TileStatement.executeQuery(TileQuery);
        RegionRows = RegionStatement.executeQuery(RegionQuery);

        while( TileRows.next() )
        {
      r=(r!=null)?r+",":"";
      r = r + "t:" +
        TileRows.getInt(1) + "/" +
        TileRows.getString("timage") + "/" +
        TileRows.getString("tdecal") + "/" +
        TileRows.getInt("tx") + "/" +
        TileRows.getInt("ty") + "/" +
        TileRows.getInt("trid");

      if( TileRows.getInt("eid") != 0 )
          r = r + ",e:" +
            TileRows.getInt(1) + "/" +
            TileRows.getString("etype") + "/" +
            TileRows.getInt("eparama") + "/" +
            TileRows.getInt("eparamb") + "/" +
            TileRows.getInt("eparamc") + "/";
        }

        while( RegionRows.next() )
      r = r + ",r:" +
        RegionRows.getInt(1) + "/" +
        RegionRows.getString("rtype") + "/" +
        RegionRows.getString("rname") + "/" +
        RegionRows.getString("rsx") + "/" +
        RegionRows.getString("rsy") + "/" +
        RegionRows.getString("rex") + "/" +
        RegionRows.getString("rey");

        r = r + "," + p.Write();

        /*while( PlayerRows.next() )
      r = r + ",p:" + PlayerRows.getInt("pid") + "/" + PlayerRows.getString("pname") + "/" + PlayerRows.getInt("px") + "/" + PlayerRows.getInt("py");*/

        //System.out.print(r);
        //System.out.print("Sent players and tiles. ");


    }
    else if ( Apart[0].equals("move") )
    {
        Statement TileSttmnt = Main.sql.createStatement();
        ResultSet TileRow;

        SelfRow.beforeFirst();
        SelfRow.next();
       
        int d = Integer.parseInt( Values[0] );
        if ( d <= &&  d >= 0 )
        {
      while( true ) // so we may break
      {
          int[] dS = sutil.Direction( SelfRow.getInt("px"), SelfRow.getInt("py"), d );

          SelfRow.beforeFirst();
          SelfRow.next();

          String TileQuery = "SELECT tile.*, entity.*, region.rtype FROM tile "
            + "LEFT JOIN entity ON tile.tid = entity.eid "
            + "LEFT JOIN region ON tile.trid = region.rid "
            + "WHERE tile.tx = " + dS[0] + " AND tile.ty = " + dS[1] + " ";
          //System.out.print(TileQuery);
          TileRow = TileSttmnt.executeQuery(TileQuery);

          if( TileRow.next() )
          {
        boolean Same = TileRow.getInt("trid") == SelfRow.getInt("prid");
        boolean Inside = SelfRow.getInt("rtype") == 1;

        if (! Same )
        {
            if( TileRow.getInt("rtype") == ||  SelfRow.getInt("rtype") == 1 )
            {
          if( ! Inside )
          {
              if( TileRow.getString("etype") != null &&  TileRow.getString("etype").equals("door") )
              {
            if( Opposite[ TileRow.getInt("eparama") ] != d ) break;
              } else break;
          }
          else
          {
              if( SelfRow.getString("etype") != null &&  SelfRow.getString("etype").equals("door") )
              {
            if( SelfRow.getInt("eparama") != d ) break;
              } else break;
          }
            }

        }

        Statement PlayerStatement = Main.sql.createStatement();
        String PlayerQuery = "UPDATE player SET px = " + dS[0] + ", py = " + dS[1] + ", ptid = " + TileRow.getInt("tid") + ", prid = " + TileRow.getInt("trid") + " WHERE pid = " + pid;
        PlayerStatement.execute( PlayerQuery );
        SelfRow = SelfSttmnt.executeQuery(SelfQuery);
        SelfRow.next();
        Frags.Patch( p = new Player( SelfRow.getInt("pid"), SelfRow.getString("pname"), dS[0], dS[1] ) );

        for( Seat s : Bus.values() )
        {
            Seat Scapegoat, Sin;
            Scapegoat = ( this.sid > s.sid ) ? s : this;
            Sin = ( Scapegoat == this ) ? s : this;
           
            if ( s == this ) continue;
            if ( Scapegoat.See(Sin) )
            {
          if ( !Scapegoat.Seen(Sin) )
          {
              Scapegoat.Seen.add(Sin);
              Frags.Patch( s.p );
          }
         
          s.Frags.Patch( p );
         
            }
            else if ( Scapegoat.Seen(Sin) )
            {
          Scapegoat.Seen.remove(Sin);
          s.Frags.Patch( new Player( pid ) );
            }
        }
       
        r = "";

View Full Code Here

Examples of fr.soleil.comete.swing.Player

public class PlayerDemo {

    public static void main(String[] args) {

        final Player player = new Player();
        JPanel panel = new JPanel();
        panel.setLayout(new BorderLayout());

        panel.add(player, BorderLayout.CENTER);
        player.addPlayerListener(new IPlayerListener() {

            @Override
            public void indexChanged(PlayerEvent event) {
                System.out.println("index changed =" + player.getIndex());
            }
        });

        player.initSlider(10);
        // bean.start();

        JFrame frame = new JFrame();
        panel.setSize(1500, 300);
        frame.setSize(1500, 300);
View Full Code Here

Examples of fr.soleil.comete.swt.Player

        // set a background to let user see limits of the component
        componentPanel.setBackground(new Color(Display.getCurrent(), 255, 175, 175));// PINK as in awt

        //Combo box
        final Player theComponent = new Player(componentPanel, SWT.NONE);
        theComponent.setLayoutData(new RowData(300, 50));
        theComponent.initSlider(10);
        theComponent.setIndex(0);

        // ----------
        Group testPanel = getTestPanel(mainComposite, theComponent);

        GridData testPanelGridData = new GridData();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.