コード例 #1
0
ファイル: HunterTest.java プロジェクト: wuqiangxjtu/hunter
 @Test(description = "endTrace后调用newSpan等,warning日志中记录了NullpointException,并且被正确捕获")
 public void testService3() {
   Hunter.startTracer(ip, port, serviceName, spanCollector, null, 1L, 11L, false);
   //		firstService.serviceA();
   Hunter.endTrace();
   firstService.serviceA();
 }
コード例 #2
0
ファイル: HunterVisual.java プロジェクト: saeko08/khaky-birds
  @Override
  public void draw(SpriteBatcher batcher, Camera2D camera, float deltaTime) {
    Vector3 pos = m_hunter.getPosition();
    BoundingBox bs = m_hunter.getBoundingShape();

    // select an animation appropriate to the state the pedestrian's in
    switch (m_hunter.m_state) {
      case Aiming:
        {
          m_animationPlayer.select(ANIM_AIM);
          break;
        }
      case AimingZombie:
        {
          m_animationPlayer.select(ANIM_AIM);
          break;
        }

      case Shooting:
        {
          m_animationPlayer.select(ANIM_SHOOT);
          break;
        }
      case ShootingZombie:
        {
          m_animationPlayer.select(ANIM_SHOOT);
          break;
        }

      case S*****d:
        {
          m_animationPlayer.select(ANIM_SHITTED);
          break;
        }
      case Eaten:
        {
          m_animationPlayer.select(ANIM_AIM);
          break;
        }
    }

    // draw the hunter
    batcher.drawSprite(
        pos.m_x,
        pos.m_y,
        bs.getWidth(),
        bs.getHeight(),
        m_hunter.getFacing(),
        m_animationPlayer.getTextureRegion(m_hunter, deltaTime));
  }
コード例 #3
0
 public void generateHunter(Hunter lewis) {
   System.out.println("Assigning a hunter...");
   try {
     Thread.sleep(1000);
   } catch (InterruptedException e) {
     e.printStackTrace();
   }
   System.out.println("This is your Hunter");
   System.out.println("\tName: " + lewis.getName());
   System.out.println("\tGun: " + lewis.getGun());
   System.out.println("\tAge: " + lewis.getAge());
   System.out.println("\tHeight: " + lewis.getHeight());
   System.out.println("\tWeight: " + lewis.getWeight());
 }
コード例 #4
0
  public void instruction(Hunter lewis) {

    try {
      Thread.sleep(1000);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }

    System.out.println("What command key do you want to put to " + lewis.getName());
    System.out.println("\tPress 1 for Practice");
    System.out.println("\tPress 2 for Chase");
    System.out.println("\tPress 3 for Shoot Animal");
    System.out.println("\tPress 4 for Shooting Animal");
    System.out.println("\tPress 5 for Dying.....Amen");
  }
コード例 #5
0
ファイル: HunterTest.java プロジェクト: wuqiangxjtu/hunter
 @Test(description = "traceId不为空,parentId不为空,isSample为真的情况下,跟踪,并且打印传入的traceId")
 public void testService4() {
   Hunter.startTracer(ip, port, serviceName, spanCollector, null, 1L, 11L, true);
   firstService.serviceA();
   Hunter.endTrace();
 }
コード例 #6
0
ファイル: HunterTest.java プロジェクト: wuqiangxjtu/hunter
 @Test(description = "traceId不为空,parentId不为空,isSample为假的情况下,不跟踪")
 public void testService2() {
   Hunter.startTracer(ip, port, serviceName, spanCollector, null, 1L, 11L, false);
   firstService.serviceA();
   Hunter.endTrace();
 }
コード例 #7
0
ファイル: HunterTest.java プロジェクト: wuqiangxjtu/hunter
 @Test(description = "traceId, parentId,isSample都是null, 日志正常,并且打印的traceId是非默认traceId")
 public void testService1() {
   Hunter.startTracer(ip, port, serviceName, spanCollector, null);
   firstService.serviceA();
   Hunter.endTrace();
 }
コード例 #8
0
ファイル: Monster.java プロジェクト: zhubenle/java
 public void kill(Hunter hunter) {
   if (isLive() & hunter.isLive()) {
     System.out.println("+++++++++++++++++>" + getType() + "向" + hunter.getName() + "发动攻击");
     hunter.injured(this);
   }
 }