PreviousUpNext

15.3.631  src/lib/x-kit/tut/badbricks-game/brick.api

## brick.api

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

# This api is implemented in:
#     src/lib/x-kit/tut/badbricks-game/brick.pkg

stipulate
    include package   threadkit;                        # threadkit             is from   src/lib/src/lib/thread-kit/src/core-thread-kit/threadkit.pkg
    #
    package wg =  widget;                               # widget                is from   src/lib/x-kit/widget/old/basic/widget.pkg
    package bj =  brick_junk;                           # brick_junk            is from   src/lib/x-kit/tut/badbricks-game/brick-junk.pkg
herein

    api Brick {
        #
        Brick;

        make_brick:     wg::Root_Window -> (bj::Position, Mailslot( bj::Mse_Evt ), bj::Palette) -> Brick;
        make_no_brick:  wg::Root_Window ->                                         bj::Palette  -> Brick;

        as_widget:  Brick -> wg::Widget;
        set_good:   Brick -> Void;
        reset:      Brick -> Void;

        state_of:   Brick -> bj::State;
        is_shown:   Brick -> Bool;
        is_good:    Brick -> Bool;

        enumerate_neighbors:  (Brick -> Void)  ->  (Brick, bj::Range, (bj::Position -> Brick))  ->  Void;
        neighbor_count:       (Brick -> Int)   ->  (Brick, bj::Range, (bj::Position -> Brick))  ->  Int;

        neighbor_good_count:  (Brick, bj::Range, (bj::Position -> Brick)) -> Int;
        neighbor_bad_count:   (Brick, bj::Range, (bj::Position -> Brick)) -> Int;
        neighbor_ok_count:    (Brick, bj::Range, (bj::Position -> Brick)) -> Int;

        show_and_flood:  (Brick, (bj::Position -> Brick)) -> Int;
        end_show:        (Brick, (bj::Position -> Brick)) -> Void;

        highlight_on:    Brick -> Void;
        highlight_off:   Brick -> Void;
        toggle_marking:  Brick -> Void;
        set_text:       (Brick, String) -> Void;
    };

end;

## COPYRIGHT (c) 1996 AT&T Research.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext