Ejemplo n.º 1
0
        private void executeAction(TranslationStepAction action)
        {
            GameObject cube = this.cubes [action.getCubeID()];

            TranslationStepAction.Direction direction = action.getDirection();

            float xNew = 0.0f, zNew = 0.0f;

            switch (direction)
            {
            case TranslationStepAction.Direction.North:
                xNew = this.stepSize;
                break;

            case TranslationStepAction.Direction.South:
                xNew = -this.stepSize;
                break;

            case TranslationStepAction.Direction.East:
                zNew = -this.stepSize;
                break;

            case TranslationStepAction.Direction.West:
                zNew = this.stepSize;
                break;

            default:
                Debug.LogError("Unknown direction " + direction);
                break;
            }

            Vector3 vec = new Vector3(xNew, 0.0f, zNew);

            this.translation.addJob(cube, vec);
        }
Ejemplo n.º 2
0
        public void addJob(string actionDescription)
        {
            Job job = new Job(TranslationStepAction.parse(actionDescription));

            this.actionID = job.getAction().getActionID();

            // Get reward string
            //this.rewardStr = this.calcRewardForAllActions ();

            lock (this.queue) {
                this.queue.Enqueue(job);
            }
            this.numActions++;
        }
Ejemplo n.º 3
0
 public Job(TranslationStepAction action)
 {
     this.action = action;
 }