PreviousUpNext

15.3.627  src/lib/x-kit/tut/arithmetic-game/calculation-pane.api

## calculation-pane.api
#
# API for the app widget which displays a pane
# showing the user an arithmetic problem like
#
#         25
#       + 36
#       ----


# Compiled by:
#     src/lib/x-kit/tut/arithmetic-game/arithmetic-game-app.lib


stipulate
    include package   threadkit;                        # threadkit                     is from   src/lib/src/lib/thread-kit/src/core-thread-kit/threadkit.pkg
herein

    # This api is implemented in:
    #
    #     src/lib/x-kit/tut/arithmetic-game/calculation-pane.pkg
    #
    api Calculation_Pane {

        Calculation_Pane;

        Right_Or_Wrong = RIGHT | WRONG;

        Difficulty = SINGLE | EASY | MEDIUM | HARD;

        Math_Op = ADD | SUBTRACT | MULTIPLY;

        math_ops:  List( (Math_Op, Bool) );
        math_op_to_string:    Math_Op -> String;

        make_calculation_pane:   (widget::Root_Window, Null_Or(Mailslot(Int))) -> Calculation_Pane;

        start_game:           Calculation_Pane -> (Difficulty, Math_Op) -> Void;
        reset:                Calculation_Pane -> Void;
        as_widget:            Calculation_Pane -> widget::Widget;
        right_or_wrong'_of:   Calculation_Pane -> threadkit::Mailop( Right_Or_Wrong );
    };
end;



Comments and suggestions to: bugs@mythryl.org

PreviousUpNext