Object <- Viewable <- Coupon |
|
|
Accepted ApplyAndDiscardCoupon ApplyCoupon CalcContentBox CanAcceptCoupon CanApply CouponImage CouponObject |
CouponText Draw DrawCoupon GiveObjectToCoupon Pressed SetPartColor Tap TextStyle |
|
Amount AutoMove Border CanDrawIn CanStretch Mode |
| Field | Type | |
|---|---|---|
| Viewable: | superview: | Viewable |
| relativeOrigin: | Dot | |
| contentSize: | Dot | |
| viewFlags: | Flags | |
| labelStyle: | TextStyle | |
| color: | Unsigned | |
| altColor: | Unsigned | |
| shadow: | Shadow | |
| sound: | Playable | |
| Coupon: | couponObject: | Object |
| selector: | Unsigned | |
| amount: | Signed |
Define Class Coupon; abstract; inherits from Viewable, BackgroundWithBorder; field couponObject: Object; field selector: Unsigned; field amount: Signed, getter, setter; attribute Amount: Signed; attribute Mode: Signed, safe; operation DrawCoupon(): Object; operation CouponImage(): Image; operation CouponText(): Text; operation CouponObject(): Object; operation GiveObjectToCoupon(newObject: Object; makeShared: Boolean); // sets couponObject field with a copy of <newObject> // if makeShared is true, makes a shared copy of <newObject> // caller owns <newObject> and is responsible for destroying it operation CanApply(applyTo: Viewable): Boolean; operation Accepted(); operation ApplyCoupon(applyTo: Viewable; where: Dot), noMethod; operation ApplyAndDiscardCoupon(applyTo: Viewable); overrides AutoMove, CalcContentBox, CanAcceptCoupon, CanDrawIn, CanStretch, Draw, Pressed, Tap; overrides Border, TextStyle, SetPartColor; end class;