本文整理汇总了C#中Move类的典型用法代码示例。如果您正苦于以下问题:C# Move类的具体用法?C# Move怎么用?C# Move使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Move类属于命名空间,在下文中一共展示了Move类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
// Use this for initialization
void Start () {
playerMovement = player.GetComponent<Move>();
initialPosition = transform.position;
print ("Initial pos: " + initialPosition.ToString ());
print ("Dissaproval: " + disapproval.ToString ());
}
示例2: Start
// Use this for initialization
void Start()
{
move = GetComponent<Move>();
//target = GameObject.FindWithTag (targetTag);
target = GameObject.Find(targetTag);
//target = GameObject.FindGameObjectWithTag (targetTag);
}
示例3: Damage
public void Damage(Pokemon otherPoke, Move move){
//this must take p account weakness and attributes (defense, attack, sp_Defense, sp_Attack)
//this must be object oriented
moveCast = move.moveType.ToString () ;
switch(move.moveType){ //These attack type and stab are not included. They(included atkpower) will have to be be invoked directly from database and switch wont be required
case MoveNames.Tackle:{
int atkPower = 35;
damage = ((((2 * otherPoke.level / 5 + 2) * otherPoke.attack * atkPower / defence) / 50) + 2) * Random.Range(217,255)/255; //((2A/5+2)*B*C)/D)/50)+2)*X)*Y/10)*Z)/255
hp -= damage/TotalHP();
isHPZero();
currentHealth -= damage;
GiveXP(10);
break;
}
case MoveNames.Scratch:{
int atkPower = 35;
damage = ((((2 * otherPoke.level / 5 + 2) * otherPoke.attack * atkPower / defence) / 50) + 2) * Random.Range(217,255)/255; //((2A/5+2)*B*C)/D)/50)+2)*X)*Y/10)*Z)/255
hp -= damage/TotalHP();
isHPZero();
GiveXP(10);
break;
}
}
}
示例4: Start
// Use this for initialization
void Start () {
player = FindObjectOfType<Move> ();
//shoots the direction right
if (player.transform.localScale.x < 0)
speed = -speed;
}
示例5: Awake
void Awake()
{
//load from xml
moves.Add(new Move());
move = moves[moves.Count-1];
move.name = "Punch Left";
move.hitTime = 0.1f;
move.duration = 0.6f;
move.damage = 7.5f;
move.reach = 0.8f;
move.forwardForce = 100;
moves.Add(new Move());
move = moves[moves.Count-1];
move.name = "Punch Right";
move.hitTime = 0.1f;
move.duration = 0.5f;
move.damage = 10f;
move.forwardForce = 125;
moves.Add(new Move());
move = moves[moves.Count-1];
move.name = "Kick";
move.hitTime = 0.2f;
move.duration = 0.7f;
move.damage = 15f;
move.reach = 1;
move.forwardForce = 150;
move.upForce = 100;
move.restrictAirControl = 1;
}
示例6: BFSNode
public BFSNode(Board nextBoard, Position blank_pos, BFSNode parent = null, Move move = null)
{
board = nextBoard;
this.blank_pos = blank_pos;
this.parent = parent;
this.move = move;
}
示例7: ReceiveMove
/// <summary>
/// Causes the player of this game to receive the given move.
/// </summary>
protected void ReceiveMove(Move Move, Board NewBoard)
{
if (this.MoveReceived != null)
{
this.MoveReceived(Move, NewBoard);
}
}
示例8: TimedMove
public TimedMove(Move move, int wait_before, int wait_after)
: base(move)
{
this.wait_before = wait_before;
this.wait_after = wait_after;
this.undo = false;
}
示例9: AStarNode
public AStarNode()
{
parent_ = null;
board_ = new Board();
blank_pos_ = new Position();
move_ = new Move();
}
示例10: BuildMoves
private static IEnumerable<Move> BuildMoves(Move move)
{
var res = new List<Move> {new Move(move.R, move.C, move.S)};
for (int i = 1; i < 3; i++)
{
res.Add(new Move(move.R, move.C, move.S + i));
res.Add(new Move(move.R, move.C, move.S - i));
res.Add(new Move(move.R, move.C + i, move.S));
res.Add(new Move(move.R, move.C - i, move.S));
res.Add(new Move(move.R, move.C + i, move.S + i));
res.Add(new Move(move.R, move.C + i, move.S - i));
res.Add(new Move(move.R, move.C - i, move.S + i));
res.Add(new Move(move.R, move.C - i, move.S - i));
res.Add(new Move(move.R + i, move.C, move.S));
res.Add(new Move(move.R - i, move.C, move.S));
res.Add(new Move(move.R + i, move.C, move.S + i));
res.Add(new Move(move.R + i, move.C, move.S - i));
res.Add(new Move(move.R - i, move.C, move.S + i));
res.Add(new Move(move.R - i, move.C, move.S - i));
res.Add(new Move(move.R + i, move.C + i, move.S + i));
res.Add(new Move(move.R + i, move.C + i, move.S - i));
res.Add(new Move(move.R + i, move.C - i, move.S + i));
res.Add(new Move(move.R + i, move.C - i, move.S - i));
res.Add(new Move(move.R - i, move.C + i, move.S + i));
res.Add(new Move(move.R - i, move.C + i, move.S - i));
res.Add(new Move(move.R - i, move.C - i, move.S + i));
res.Add(new Move(move.R - i, move.C - i, move.S - i));
}
return res.Where(m => m.IsValid()).ToList();
}
示例11: Start
// Use this for initialization
void Start () {
moveDirection = states.STOP;
player = GameObject.FindGameObjectWithTag("Player");
playerState = player.gameObject.GetComponent<Move> ();
}
示例12: Awake
//____________________________________________________________\\\\\\___MonoMethods___//////_______________________________________________________________
//_________________\\\\\\___Awake___//////_________________
// Calculates wall positions and goal posts + sets
// character + resets path
//‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
void Awake()
{
masterScript = GameObject.FindObjectOfType (typeof(MasterScript)) as MasterScript;
gameScript = GameObject.FindObjectOfType (typeof(Game)) as Game;
moveScript = GameObject.FindObjectOfType (typeof(Move)) as Move;
sinCosMovementScript = GameObject.FindObjectOfType (typeof(SinCosMovement)) as SinCosMovement;
linearRotationScript = GameObject.FindObjectOfType (typeof(LinearRotation)) as LinearRotation;
sinCosRotationScript = GameObject.FindObjectOfType (typeof(SinCosRotation)) as SinCosRotation;
this.name = "Projectile";
bounceCount = 0;
wallTop = fieldHeight / 2;
wallBottom = -fieldHeight / 2;
wallRight = fieldWidth / 2;
wallLeft = -fieldWidth / 2;
goalTop = goalHeight / 2;
goalBottom = -goalHeight / 2;
p1char = masterScript.GetCharacter (1) - 1;
p2char = masterScript.GetCharacter (2) - 1;
this.ResetPath ();
}
示例13: GetValidMoves
public override ReadOnlyCollection<Move> GetValidMoves(Position from, bool returnIfAny, ChessGame game, Func<Move, bool> gameMoveValidator)
{
ChessUtilities.ThrowIfNull(from, "from");
List<Move> validMoves = new List<Move>();
Piece piece = game.GetPieceAt(from);
int l0 = game.BoardHeight;
int l1 = game.BoardWidth;
for (int i = -7; i < 8; i++)
{
if (i == 0)
continue;
if (from.Rank + i > 0 && from.Rank + i <= l0)
{
Move move = new Move(from, new Position(from.File, from.Rank + i), piece.Owner);
if (gameMoveValidator(move))
{
validMoves.Add(move);
if (returnIfAny)
return new ReadOnlyCollection<Move>(validMoves);
}
}
if ((int)from.File + i > -1 && (int)from.File + i < l1)
{
Move move = new Move(from, new Position(from.File + i, from.Rank), piece.Owner);
if (gameMoveValidator(move))
{
validMoves.Add(move);
if (returnIfAny)
return new ReadOnlyCollection<Move>(validMoves);
}
}
}
return new ReadOnlyCollection<Move>(validMoves);
}
示例14: startTurn
public bool startTurn()
{
iteration++;
int count = 0;
count = Client.getMoveCount(connection);
moves = new Move[count];
for(int i = 0; i < count; i++)
{
moves[i] = new Move(Client.getMove(connection, i));
}
count = Client.getPieceCount(connection);
pieces = new Piece[count];
for(int i = 0; i < count; i++)
{
pieces[i] = new Piece(Client.getPiece(connection, i));
}
count = Client.getPlayerCount(connection);
players = new Player[count];
for(int i = 0; i < count; i++)
{
players[i] = new Player(Client.getPlayer(connection, i));
}
if(!initialized)
{
initialized = true;
init();
}
return run();
}
示例15: CanBeatLegalMove
protected override bool CanBeatLegalMove(Move move)
{
if (move is DynamiteMove)
return true;
return false;
}