Package com.l2client.animsystem

Examples of com.l2client.animsystem.InputProvider


    }
  }
 
  private void onValuesChanged() {
    if(target != null){
      InputProvider in = getInputFromModel();
      target.setInput(in);
    }
  }
View Full Code Here


      target = (JMESimpleController)con;
    }
  }
 
  private InputProvider getInputFromModel(){
    InputProvider in = new InputProvider();
    in.setInput((Acting) jComboBox1.getSelectedItem());
    in.setInput((AttackType) jComboBox2.getSelectedItem());
    in.setInput((Movement) jComboBox3.getSelectedItem());
    in.setInput((Target) jComboBox4.getSelectedItem());
    return in;
  }
View Full Code Here

public class AttackAction extends Action {

  @Override
  protected Animation evaluate(Mediator med) {
    Animation ret = null;
    InputProvider in = med.getInput();
    if (AttackType.None.equals(in.getInput(AttackType.class))) {
      if (med.setLockCheck(Channels.AllChannels, 2)) {
        ret = med.getAnimation();
        ret.setLevel(2);
        ret.setChannel(med.getChannel(Channels.AllChannels));
        if (rand.nextInt(9) > 5) {
View Full Code Here

  private static final Logger log = Logger.getLogger(AnimationSystemTest.class.getName());
  private String currentAnim = "";

  public void testSelf() throws MalformedURLException{
    Mediator mediator = new Mediator(getActions(), new Transitions(new String[][]{}));
    InputProvider in = new InputProvider();
    mediator.setAnimationProvider(this);
    mediator.update(0.5f);
    log.info("Animation name:"+currentAnim);
    assertTrue(currentAnim.startsWith("stand_"));
    mediator.update(10.0f);
    in.setInput(Direction.Front);
    in.setInput(Speed.Run);
    mediator.update(10.0f);
    //should still be stand, one frame coherence
    assertTrue(currentAnim.startsWith("stand_"));
    log.info("Animation name:"+currentAnim);
    mediator.setInput(in);
    mediator.update(10.0f);
    //now changed
    log.info("Animation name:"+currentAnim);
    assertTrue(currentAnim.startsWith("run"));
    mediator.update(10.0f);
    log.info("Animation name:"+currentAnim);
    assertTrue(currentAnim.startsWith("run"));
    in = new InputProvider();
    in.setInput(Direction.None);
    in.setInput(Speed.Run);//implizit overrule of speed (no direction, no speed)
    mediator.setInput(in);
    mediator.update(10.0f);
    //back to idle?
    assertTrue(currentAnim.startsWith("stand_"));
    in = new InputProvider();
    in.setInput(Enemy.Near);
    mediator.setInput(in);
    mediator.update(10.0f);
    //now changed
    log.info("Animation name:"+currentAnim);
    assertTrue(currentAnim.startsWith("ready"));
   
    mediator.update(10.0f);
    mediator.update(10.0f);
    in = new InputProvider();
    in.setInput(HurtVector.Front);
    in.setInput(Hurt.Light);
    mediator.callAction("Wounded", in);
    mediator.update(10f);
    log.info("Animation name:"+currentAnim);
    assertTrue(currentAnim.startsWith("knockback"));
   
View Full Code Here

TOP

Related Classes of com.l2client.animsystem.InputProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.