graphic_piece
= cluster is create, destroy, moveto, get_color, get_kind
- Overview
- a graphic_piece is a visible, mutable object. It is a chess piece which is located on a graphic_board.
- written by pepellet
- create = proc(gb: graphic_board, pc: pieceColor, pk: pieceKind, r: int, c: int)
returns(cvt)
- requires: gb has not been destroyed, and gb.window has not been destroyed.
- modifies: gb and gb.window
- effects: creates, displays, and returns a new graphic_piece of color pc and kind pk, located on graphic_board gb at row r and column c.
- destroy = proc(gp: cvt)
- requires: gp has not been destroyed, and the window gp exists in has not been destroyed
- modifies: the window gp exists in
- effects: removes gp from the window
- moveto = proc(gp: cvt, r: int, c: int)
- requires: gp has not been destroyed, and the window gp exists in has not been destroyed
- modifies: gp
- effects: moves gp to row r and column c
- get_color = proc(gp: cvt) returns (pieceColor)
- effects: returns the color of piece gp
- get_kind = proc(gp: cvt) returns (pieceKind)
- effects: returns the kind of piece gp