⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 playerinfo.java

📁 Massively Multiplayer Space Trading and Combat game. This is an online strategy game, not a 3D space
💻 JAVA
字号:
/*
 * PlayerInfo.java
 *
 * Copyright (C) 2000 Jason M. Hanley
 * Released under the GNU General Public License (GPL)
 * See license.txt for additional information.
 *
 * Created on July 24, 2000, 11:29 PM
 */
 
package fate.network;

import java.io.*;

import fate.*;
import fate.server.*;
import fate.world.*;

/** 
 * Stores player info, such as user ID, username, password, email, etc.
 *
 * @author  preylude@s3m.com
 * @version 0.1.0
 */
public class PlayerInfo extends Object implements Comparable, Serializable {

  public String username;
  public String password;
  public int id;
  
  /** Maps to the {@link Player} object in the Fate World. */
  public int idPlayer;
//  Player player; // we don't want to serialize the entire world with this
  
  /** Keeps track of the player's current state in the virtual world */
  public PlayerState state;
  
  /** Creates new PlayerInfo */
  public PlayerInfo( String username, String password ) {
    this.username = username;
    this.password = password;

    state = new PlayerState();
  }
  
  /** Returns the {@link Player} object associated with this user account */
  public Player getPlayer() {
    return (Player)(FateServer.universe.mapPlayers.get( idPlayer ));
  }
  
  /** Convert to a string */
  public String toString() {
    return username;
  }
  
  public int compareTo( final Object playerInfo ) {
    return username.compareTo( ((PlayerInfo)playerInfo).username );
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -