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); }
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++; }
public Job(TranslationStepAction action) { this.action = action; }