Package edu.cmu.cs.stage3.alice.core

Examples of edu.cmu.cs.stage3.alice.core.Variable


public abstract class StackBooleanQuestion extends edu.cmu.cs.stage3.alice.core.question.BooleanQuestion {
  public final StackProperty stack = new StackProperty( this, "stack", null );
  protected abstract boolean getValue( Stack stack );
  public Object getValue() {
    Stack stackValue = stack.getStackValue();
    if( stackValue!=null ) {
            if( getValue( stackValue ) ) {
                return Boolean.TRUE;
            } else {
                return Boolean.FALSE;
View Full Code Here


        // look

        subject.getTransformableValue().turnRightNow(Direction.FORWARD,turning.x*dt);


        Transformable t = new Transformable();
        t.setPositionRightNow(subject.getTransformableValue().getPosition());
        t.setOrientationRightNow(subject.getTransformableValue().vehicle.getReferenceFrameValue().getOrientationAsQuaternion());

        subject.getTransformableValue().turnRightNow(Direction.RIGHT,turning.y*dt,t);

        // move

View Full Code Here

    long dt = mouseEvent.getWhen() - m_pressedEvent.getWhen();
    if( dt < m_clickTimeThreshold ) {
      if( dx*dx + dy*dy < m_clickDistanceThresholdSquared ) {
        if( isEnabled.booleanValue() ) {
          if( checkModifierMask( mouseEvent ) ) {
            Transformable onWhatValue = onWhat.getTransformableValue();
            boolean success;
            if( onWhatValue!=null ) {
              edu.cmu.cs.stage3.alice.scenegraph.renderer.PickInfo pickInfo = RenderTarget.pick( mouseEvent );
              if( pickInfo.getCount()>0 ) {
                Model model = (Model)( pickInfo.getVisualAt( 0 ).getBonus() );
                success = onWhatValue == model || onWhatValue.isAncestorOf( model );
              } else {
                success = false;
              }
            } else {
              success = true;
View Full Code Here

public abstract class SubjectObjectQuestion extends SubjectQuestion {
  public final TransformableProperty object = new TransformableProperty( this, "object", null );
  protected abstract Object getValue( Transformable subjectValue, Transformable objectValue );
  protected Object getValue( Transformable subjectValue ) {
    Transformable objectValue = object.getTransformableValue();
    return getValue( subjectValue, objectValue );
  }
View Full Code Here

  public final TransformableProperty owner = new TransformableProperty( this, "owner", null );
    public final StringProperty variableName = new StringProperty( this, "variableName", "" );
    public final ClassProperty valueClass = new ClassProperty( this, "valueClass", null );
  public final BooleanProperty ignoreCase = new BooleanProperty( this, "ignoreCase", Boolean.TRUE );
  public Object getValue() {
    Transformable ownerValue = owner.getTransformableValue();
    String nameValue = variableName.getStringValue();
        if( ownerValue != null ) {
            for( int i=0; i<ownerValue.variables.size(); i++ ) {
                Variable variableI = (Variable)ownerValue.variables.get( i );
                if( variableI != null ) {
View Full Code Here

            turning.z = maxTurning.getNumberValue().doubleValue();

        // move

        javax.vecmath.Vector3d vector = new javax.vecmath.Vector3d( dt*speed.x, dt*speed.y, dt*speed.z );
        Transformable subjectTransformable = subject.getTransformableValue();
    try {
      vector = subjectTransformable.preventPassingThroughOtherObjects( vector, 2 );
    } catch( Throwable t ) {
      //pass
    }
        subjectTransformable.moveRightNow( vector );
        /*
        double yPos = ((Transformable)subject.get()).getPosition().getItem(1);
        ((Transformable)subject.get()).moveRightNow(Direction.FORWARD,dt*speed.z);
        if (((Boolean)stayOnGround.get()).booleanValue()) {
            Vector3 pos = ((Transformable)subject.get()).getPosition();
            pos.setItem(1,yPos);
            ((Transformable)subject.get()).setPositionRightNow(pos);
        }
        ((Transformable)subject.get()).moveRightNow(Direction.RIGHT,dt*speed.x);
        ((Transformable)subject.get()).moveRightNow(Direction.UP,dt*speed.y);
        */
        ((Transformable)subject.get()).turnRightNow(Direction.FORWARD,dt*turning.x);


        if (((Boolean)stayOnGround.get()).booleanValue()) {
            Transformable t = new Transformable();
            t.setPositionRightNow(((Transformable)subject.get()).getPosition(((Transformable)subject.get()).getWorld()));
            //t.setOrientationRightNow(((Transformable)subject.get()).getWorld().getOrientationAsQuaternion());
            ((Transformable)subject.get()).turnRightNow(Direction.RIGHT,dt*turning.y,t);
        } else {
            ((Transformable)subject.get()).turnRightNow(Direction.RIGHT,dt*turning.y);
        }
View Full Code Here

      }
    }
  }

  private boolean check( edu.cmu.cs.stage3.alice.core.event.MessageEvent messageEvent ) {
    Transformable fromWhoValue = fromWho.getTransformableValue();
    if( fromWhoValue==null || messageEvent.getFromWho()==fromWhoValue ) {
      Transformable toWhomValue = toWhom.getTransformableValue();
      if( toWhomValue==null || messageEvent.getToWhom()==toWhomValue ) {
        return true;
      }
    }
    return false;
View Full Code Here

        // look

        subject.getTransformableValue().turnRightNow(Direction.FORWARD,turning.x);


        Transformable t = new Transformable();
        t.setPositionRightNow(subject.getTransformableValue().getPosition());
        t.setOrientationRightNow(subject.getTransformableValue().vehicle.getReferenceFrameValue().getOrientationAsQuaternion());

        subject.getTransformableValue().turnRightNow(Direction.RIGHT,turning.y,t);

        turning.x = 0;
        turning.y = 0;
View Full Code Here

public abstract class SizeAlongDimensionQuestion extends Question {
  public final TransformableProperty subject = new TransformableProperty( this, "subject", null );
  protected abstract Dimension getDimension();
  public Object getValue() {
    Transformable subjectValue = subject.getTransformableValue();
    if( subjectValue!=null ) {
      return new Double( subjectValue.getSizeAlongDimension( getDimension() ) );
    } else {
      return null;
    }
  }
View Full Code Here

public abstract class SubjectQuestion extends Question {
  public final TransformableProperty subject = new TransformableProperty( this, "subject", null );
  protected abstract Object getValue( Transformable subjectValue );
  public Object getValue() {
    Transformable subjectValue = subject.getTransformableValue();
    return getValue( subjectValue );
  }
View Full Code Here

TOP

Related Classes of edu.cmu.cs.stage3.alice.core.Variable

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.