本文整理汇总了C#中Move类的典型用法代码示例。如果您正苦于以下问题:C# Move类的具体用法?C# Move怎么用?C# Move使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Move类属于命名空间,在下文中一共展示了Move类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 ());
}
开发者ID:DiegoArmando,项目名称:GameJam2016,代码行数:8,代码来源:Bar.cs
示例2: Start
// Use this for initialization
void Start()
{
move = GetComponent<Move>();
//target = GameObject.FindWithTag (targetTag);
target = GameObject.Find(targetTag);
//target = GameObject.FindGameObjectWithTag (targetTag);
}
开发者ID:Gloader,项目名称:Laboratory,代码行数:8,代码来源:AIMoveController.cs
示例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;
}
}
}
开发者ID:Arpit0492,项目名称:Unity,代码行数:25,代码来源:Pokemon.cs
示例4: Start
// Use this for initialization
void Start () {
player = FindObjectOfType<Move> ();
//shoots the direction right
if (player.transform.localScale.x < 0)
speed = -speed;
}
开发者ID:RickyEz7,项目名称:1600-DGM,代码行数:8,代码来源:Projectile.cs
示例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;
}
开发者ID:kuribohlv9,项目名称:OpenSmash-Proto,代码行数:31,代码来源:MoveDatabase.cs
示例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;
}
开发者ID:djquirke,项目名称:AIPersonal,代码行数:7,代码来源:AI_BFS.cs
示例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);
}
}
开发者ID:dzamkov,项目名称:XChess,代码行数:10,代码来源:Game.cs
示例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;
}
开发者ID:alexhanh,项目名称:Botting-Library,代码行数:7,代码来源:TimedMove.cs
示例9: AStarNode
public AStarNode()
{
parent_ = null;
board_ = new Board();
blank_pos_ = new Position();
move_ = new Move();
}
开发者ID:djquirke,项目名称:AIPersonal,代码行数:7,代码来源:AI_AStar.cs
示例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();
}
开发者ID:Zanoellia,项目名称:etablirond,代码行数:32,代码来源:Program.cs
示例11: Start
// Use this for initialization
void Start () {
moveDirection = states.STOP;
player = GameObject.FindGameObjectWithTag("Player");
playerState = player.gameObject.GetComponent<Move> ();
}
开发者ID:Kostas333,项目名称:PiratesDemo,代码行数:8,代码来源:movigObjectScript.cs
示例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 ();
}
开发者ID:Christoph-M,项目名称:PongKlohn,代码行数:31,代码来源:Ball.cs
示例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);
}
开发者ID:ProgramFOX,项目名称:Chess.NET,代码行数:34,代码来源:Rook.cs
示例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();
}
开发者ID:siggame,项目名称:chess,代码行数:30,代码来源:BaseAI.CS
示例15: CanBeatLegalMove
protected override bool CanBeatLegalMove(Move move)
{
if (move is DynamiteMove)
return true;
return false;
}
开发者ID:aaronjensen,项目名称:compete.rock_paper_scissors_pro,代码行数:7,代码来源:WaterBalloonMove.cs
示例16: addFail
/** Record move as a failure. */
public void addFail(Position pos, Move m, int depth)
{
int p = pos.getPiece(m.from);
int cnt = depth;
countFail[p][m.to] += cnt;
score[p][m.to] = -1;
}
开发者ID:Chessforeva,项目名称:Csharp4chess,代码行数:8,代码来源:History.cs
示例17: Turn
public Move Turn() {
while(true) {
Move move = new Move(new Location(random.Next(0,BoardSize),random.Next(0,BoardSize)),(MoveType)random.Next(0,7));
if(!Program.VerifyMove(move,BotNumber)) continue;
return move;
}
}
开发者ID:mistopportunity,项目名称:Checkers,代码行数:7,代码来源:Redgy.cs
示例18: EqualsReturnsFalseWhenBoardIsDifferent
public void EqualsReturnsFalseWhenBoardIsDifferent()
{
int[,] data1 = {
{9,0,0, 0,0,5, 6,8,1 },
{0,6,0, 2,8,0, 7,0,0 },
{0,0,0, 0,0,6, 9,0,5 },
{0,8,0, 0,0,2, 0,4,6 },
{0,0,5, 0,0,0, 3,0,0 },
{1,9,0, 5,0,0, 0,7,0 },
{8,0,2, 9,0,0, 0,0,0 },
{0,0,9, 0,2,7, 0,6,0 },
{6,7,4, 8,0,0, 0,0,3 }
};
int[,] data2 = {
{9,0,0, 0,0,5, 6,8,1 },
{0,6,0, 2,8,0, 7,0,0 },
{0,0,0, 0,0,6, 9,0,5 },
{0,8,0, 0,0,2, 0,4,6 },
{0,0,5, 0,0,0, 3,0,0 },
{1,9,0, 5,0,0, 0,7,0 },
{8,0,2, 9,0,0, 0,0,0 },
{0,0,9, 0,2,7, 0,6,0 },
{6,7,4, 8,0,0, 0,1,3 }
};
IBoard board1 = new Board(data1);
IBoard board2 = new Board(data2);
IMove move1 = new Move(board1, 0, 1, 2);
IMove move2 = new Move(board2, 0, 1, 2);
Assert.False(move1.Equals(move2));
Assert.False(move2.Equals(move1));
}
开发者ID:sayedihashimi,项目名称:sudoku,代码行数:35,代码来源:MoveTests.cs
示例19: Move
public void Move(Wizard self, World world, Game game, Move move)
{
#if DEBUG
// один раз вызвать Begin*()
vc.BeginPost();
#endif
move.Speed = game.WizardForwardSpeed;
move.StrafeSpeed = game.WizardStrafeSpeed;
move.Turn = game.WizardMaxTurnAngle;
move.Action = ActionType.MagicMissile;
#if DEBUG
// вывод отладочной информации
vc.Text(self.X - 35, self.Y - 37, string.Format("{0:D} | {1:F0} : {2:F0}", self.RemainingCooldownTicksByAction[(int)ActionType.MagicMissile], self.X, self.Y));
vc.Line(self.X, self.Y, self.X + Math.Cos(self.Angle - game.StaffSector / 2f)*self.CastRange, self.Y + Math.Sin(self.Angle - game.StaffSector / 2f)*self.CastRange, 1f, 0.7f, 0.7f);
vc.Line(self.X, self.Y, self.X + Math.Cos(self.Angle + game.StaffSector / 2f) * self.CastRange, self.Y + Math.Sin(self.Angle + game.StaffSector / 2f) * self.CastRange, 1f, 0.7f, 0.7f);
vc.Arc(self.X, self.Y, self.CastRange, self.Angle - game.StaffSector / 2f, game.StaffSector, 1f, 0.7f, 0.7f);
#endif
move.Turn = 0.01;
move.Speed = 3;
move.Action = ActionType.MagicMissile;
#if DEBUG
// в конце вызвать End*()
vc.EndPost();
#endif
}
开发者ID:JustAMan,项目名称:russian-ai-cup-visual,代码行数:25,代码来源:MyStrategy.sample.cs
示例20: EndGame
public override void EndGame(Virus percept) {
if (learn) {
double reward = 0;
byte winner = percept.Winner;
if (winner == playerNumber)
reward = 1;
else if (winner != playerNumber && winner != 0)
reward = -1;
else
reward = 0;
if (!N.ContainsKey(prevState.CustomHash()))
N.Add(prevState.CustomHash(), new Dictionary<UInt32, int>());
if (!N[prevState.CustomHash()].ContainsKey(prevAction.CustomHash()))
N[prevState.CustomHash()].Add(prevAction.CustomHash(), 0);
N[prevState.CustomHash()][prevAction.CustomHash()]++;
Q[prevState.CustomHash()][prevAction.CustomHash()] =
Q[prevState.CustomHash()][prevAction.CustomHash()]
+ LearningRate(N[prevState.CustomHash()][prevAction.CustomHash()])
* (reward - Q[prevState.CustomHash()][prevAction.CustomHash()]);
}
prevState = default(VirusBoard);
prevAction = default(Move);
prevReward = 0;
}
开发者ID:Armienn,项目名称:Virus,代码行数:26,代码来源:QAgent.cs
注:本文中的Move类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论