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

📄 remoteplayer.cs

📁 Beginning C# Game Programming 的源代码
💻 CS
字号:
using System;
using System.Net.Sockets;

namespace SpaceWar {
	/// <summary>
	/// Holds information about the other players in the game.
	/// </summary>
	public class RemotePlayer {
		Ship ship;
		int playerID;
		string hostName;
		DateTime updateTime;			// last tick count at update
		bool active = true;				// is this player active

		public RemotePlayer(int playerID, string hostName, Ship ship) {
			this.playerID = playerID;
			this.hostName = hostName;
			this.ship = ship;
		}

		public override string ToString() {
			return hostName;
		}

		public Ship Ship {
			get {
				return ship;
			}
		}

		public int PlayerID {
			get {
				return playerID;
			}
		}
		
		public DateTime UpdateTime {
			get {
				return updateTime;
			}
			set {
				updateTime = value;
			}
		}

		public bool Active {
			get {
				return active;
			}
			set {
				active = value;
			}
		}

	}
}

⌨️ 快捷键说明

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