当前位置: 首页>>代码示例>>C#>>正文


C# Move类代码示例

本文整理汇总了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 ());
	}
开发者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


注:本文中的Move类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。