Class AdditionInstruction
java.lang.Object
dev.zemco.codegame.execution.instructions.AdditionInstruction
- All Implemented Interfaces:
IInstruction
Instruction that adds constant to value held in working
memory cell.- Author:
- Erik Zemčík
-
Constructor Summary
ConstructorsConstructorDescriptionAdditionInstruction(int addend) Creates an instance ofAdditionInstructionwith the specified addition constant. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(IExecutionContext executionContext) Adds constant to value held in workingmemory cell.
-
Constructor Details
-
AdditionInstruction
public AdditionInstruction(int addend) Creates an instance ofAdditionInstructionwith the specified addition constant.- Parameters:
addend- constant to add to workingmemory cellduring execution
-
-
Method Details
-
execute
Adds constant to value held in workingmemory cell.- Specified by:
executein interfaceIInstruction- Parameters:
executionContext- context on which the instruction is executed- Throws:
IllegalArgumentException- ifexecutionContextisnullInstructionExecutionException- if workingmemory cellhas no value
-