本文整理汇总了C#中PlayerType类的典型用法代码示例。如果您正苦于以下问题:C# PlayerType类的具体用法?C# PlayerType怎么用?C# PlayerType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlayerType类属于命名空间,在下文中一共展示了PlayerType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RespawnPlayer
public void RespawnPlayer(PlayerType playerType){
if (this){
if (isActiveAndEnabled){
StartCoroutine(RespawnMeInLevel(playerType));
}
}
}
示例2: Player
public Player(int playerNumber, PlayerType type)
{
this.playerNumber = playerNumber;
this.currentPosition = null;
this.possibleMoves = Move.getPossibleMoves(Core.drawCube.cube, currentPosition);
this.type = type;
if (type == PlayerType.AI)
{
switch (playerNumber)
{
case 1:
setAIFunc(Config.getValue("ai", "player_one"));
break;
case 2:
setAIFunc(Config.getValue("ai", "player_two"));
break;
}
}
}
示例3: Player
public Player(String id, List<Card> cards, Card currentCard, PlayerType playerType)
{
this.id = id;
this.cards = cards;
this.currentCard = currentCard;
this.playerType = playerType;
}
示例4: Player
// CONSTRUCTORS
public Player(PlayerType type, int spriteWidht, int spriteHeight)
{
if (type == PlayerType.Hero)
{
this.Hitbox = new Rectangle(120, 120, spriteWidht, spriteHeight);
this.FrameLine = 1;
this.FrameColumn = 3;
this.Effects = SpriteEffects.None;
this.Direction = Direction.Down;
this.Animation = true;
this.Timer = 0;
}
if (type == PlayerType.Ennemy)
{
this.IAHitbox = new Rectangle(120, 120, spriteWidht, spriteHeight);
this.FrameLine = 1;
this.FrameColumn = 3;
this.Effects = SpriteEffects.None;
this.Direction = Direction.Down;
this.Animation = true;
this.Timer = 0;
}
if (type == PlayerType.Munition)
{
this.MuniHitbox = new Rectangle(120, 120, spriteWidht, spriteHeight);
this.FrameLine = 1;
this.FrameColumn = 3;
this.Effects = SpriteEffects.None;
this.Direction = Direction.Down;
this.Animation = true;
this.Timer = 0;
}
}
示例5: Engine
public Engine(PlayerType playerType, IUserInterface inputInterface)
{
this.PlayerType = playerType;
this.rnd = new Random();
this.inputInterface = inputInterface;
this.AllObjects = new List<WorldObject>();
}
示例6: PlayerFactory
public PlayerFactory(PlayerType playerType, string url)
{
PreparedPlayerType = playerType;
PreparedUrl = url;
SelectPlayerType();
PreparePlayer();
}
示例7: ChangeRole
public virtual void ChangeRole(PlayerType newRole, bool respawn = false)
{
Debug.Log(this.gameObject.name + " Change type from: "+this.Type +" to: " + newRole);
// Set new role
this.Type = newRole;
}
示例8: OnPlayerDied
private void OnPlayerDied(PlayerType param)
{
_advanceCountdown = advanceLevelDelayLevelDeath;
_nextLevelName = _levelSequence[_currentLevel];
CameraFade.StartAlphaFade(Color.black, false, _advanceCountdown, 2f, () => { Application.LoadLevel(_nextLevelName); });
}
示例9: SetControls
public void SetControls(PlayerType playerType){
if (playerType == PlayerType.Explo){
horizontal = "P1_Horizontal";
vertical = "P1_Vertical";
action = "P1_Action";
jump = "P1_Jump";
pause = "P1_Pause";
toss = "P1_Toss";
door = "P1_Door";
toggleCamera = "P1_ToggleCamera";
restart = "P1_Restart";
isExplo = true;
}
else if (playerType == PlayerType.Implo){
horizontal = "P2_Horizontal";
vertical = "P2_Vertical";
action = "P2_Action";
jump = "P2_Jump";
pause = "P2_Pause";
toss = "P2_Toss";
door = "P2_Door";
toggleCamera = "P2_ToggleCamera";
restart = "P2_Restart";
isExplo = false;
}
}
示例10: Empire
public Empire(string emperorName, int empireID, Race race, PlayerType type, Color color, GameMain gameMain)
: this()
{
Reserves = 0;
TaxRate = 0;
this.empireName = emperorName;
this.empireID = empireID;
this.type = type;
EmpireColor = color;
try
{
TechnologyManager.SetComputerTechs(gameMain.MasterTechnologyManager.GetRandomizedComputerTechs());
TechnologyManager.SetConstructionTechs(gameMain.MasterTechnologyManager.GetRandomizedConstructionTechs());
TechnologyManager.SetForceFieldTechs(gameMain.MasterTechnologyManager.GetRandomizedForceFieldTechs());
TechnologyManager.SetPlanetologyTechs(gameMain.MasterTechnologyManager.GetRandomizedPlanetologyTechs());
TechnologyManager.SetPropulsionTechs(gameMain.MasterTechnologyManager.GetRandomizedPropulsionTechs());
TechnologyManager.SetWeaponTechs(gameMain.MasterTechnologyManager.GetRandomizedWeaponTechs());
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
EmpireRace = race;
}
示例11: ThreadedLimakeGame
public ThreadedLimakeGame(PlayerType Green, PlayerType Red, PlayerType Blue, PlayerType Yellow)
{
beersDrunk = new int[5];
IPlayer[] players = new IPlayer[] { GetPlayer(Green), GetPlayer(Red), GetPlayer(Blue), GetPlayer(Yellow) };
game = new Game(this, players);
}
示例12: GetPrefabInstanceFromType
public static GameObject GetPrefabInstanceFromType( PlayerType type )
{
string objectName;
switch (type) {
case PlayerType.PLAYER:
objectName = "PlayerNormal";
break;
case PlayerType.MONSTER:
objectName = "Toothy";
break;
case PlayerType.AI_MONSTER:
objectName = "AIToothy";
break;
case PlayerType.AI_PLAYER:
objectName = "AIPlayerNormal";
break;
default:
objectName = "AIPlayerNormal";
break;
}
string localPath = "Prefabs/Characters/" + objectName;
Object localInstance = Resources.Load<GameObject>( localPath );
GameObject instance = Instantiate( localInstance ) as GameObject;
return instance;
}
示例13: Create
public static ReversiPlayer Create(PlayerType type, int color)
{
switch (type)
{
case PlayerType.MiniMax1:
return new ReversiPlayer(color, new MinMaxStrategy(new ScoreAndCornersEvaluator(), 2, color));
case PlayerType.MiniMax2:
return new ReversiPlayer(color, new MinMaxStrategy(new ScoreAndCornersEvaluator(), 4, color));
case PlayerType.MiniMax25:
return new ReversiPlayer(color, new MinMaxStrategy(new ScoreAndCornersEvaluator(), 5, color));
case PlayerType.MiniMax3:
return new ReversiPlayer(color, new MinMaxStrategy(new ScoreAndCornersEvaluator(), 6, color));
case PlayerType.Random:
return new ReversiPlayer(color, new RandomStrategy());
case PlayerType.AlwaysFirst:
return new ReversiPlayer(color, new AlwaysFirstStrategy());
case PlayerType.Minimax2WithoutCorners:
return new ReversiPlayer(color, new MinMaxStrategy(new ScoreEvaluator(), 2, color));
case PlayerType.DynamicMinmax:
return new ReversiPlayer(color, new DynamicMinMaxStrategy(color));
default:
return null;
}
}
示例14: Player
public Player(List<Player> players, OutputType outputType)
{
writer = new Output(outputType);
writer.Write("Enter the name of the player: ");
this.name = Console.ReadLine().Trim();
writer.Write("Enter the piece you want to use: ");
this.piece = new Piece(Console.ReadLine().Trim());
while (players.Select(p => p).Where(x => string.Compare(x.Piece.Symbol, this.piece.Symbol) == 0).Count() >= 1)
{
writer.Write("That piece has already been taken.\nChoose a different piece: ");
this.piece = new Piece(Console.ReadLine().Trim());
}
writer.Write("Is this player HUMAN or AI: ");
do
{
var playerType = Console.ReadLine().Trim();
PlayerType humanOrNot;
if (Enum.TryParse<PlayerType>(playerType.ToUpper(), out humanOrNot))
{
this.playerType = humanOrNot;
break;
}
writer.Write("Enter a valid Player Type: [human] or [AI]: ");
continue;
} while (true);
this.order = -1;
}
示例15: Game
public Game(ref Player playerA,ref Player playerB,Difficulty difficulty,GameMode gameMode)
{
current_game = this;
board = new PlayerType[3,3]{{PlayerType.NONE,PlayerType.NONE,PlayerType.NONE},
{PlayerType.NONE,PlayerType.NONE,PlayerType.NONE},
{PlayerType.NONE,PlayerType.NONE,PlayerType.NONE}};
this.playerA = playerA;
this.playerA.score = 0;
this.playerB = playerB;
this.difficulty = difficulty;
this.game_mode = gameMode;
if (game_mode == GameMode.SINGLE_PLAYER)
{
//playerA.name = "User";
playerB.name = "Computer";
playerA.moveAllowed = true;
playerB.moveAllowed = false;
}else if(game_mode == GameMode.MULTI_PLAYER_STANDALONE){
//playerA.name = "Ball";
playerB.name = "Cross";
//playerA.moveAllowed = true;
playerB.moveAllowed = false;
this.difficulty = Difficulty.NONE;
}
else if (game_mode == GameMode.MULTI_PLAYER)
{
this.difficulty = Difficulty.NONE;
}
this.current_player = playerA;
this.connected = false;
}