DMDragonModelImpl.mesa
Written By: Pradeep Sindhu
Last Edited By: Pradeep Sindhu August 28, 1985 6:11:51 pm PDT
DMDragonModelImpl:
CEDAR
PROGRAM
IMPORTS DM
EXPORTS DMDragonModel = BEGIN OPEN DMDragonModel;
Create:
PUBLIC
PROC [subComponents:
DM.ComponentList]
RETURNS [dm:
DM.Component] = {
dm ←
NEW [
DM.ComponentRec ← [
action: [Reset, PhA, EvPhA, PhB, EvPhB],
history: NIL,
componentType: $Dragon,
subComponents: subComponents,
specific: NIL
]]
};
PhA:
DM.ActionProc = {
DM.ListApply[component.subComponents, PhA]
};
EvPhA:
DM.ActionProc = {
DM.ListApply[component.subComponents, EvPhA]
};
PhB:
DM.ActionProc = {
DM.ListApply[component.subComponents, PhB]
};
EvPhB:
DM.ActionProc = {
DM.ListApply[component.subComponents, EvPhB]
};
Reset:
DM.ActionProc = {
DM.ListApply[component.subComponents, Reset];
component.history ← NIL
};
END.