diff --git a/Taskfile.yml b/Taskfile.yml index d6c3e7c..2a0c2c6 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -6,9 +6,14 @@ version: 3 vars: MOON_MODULES: - sh: echo ./src && find ./example -maxdepth 1 -mindepth 1 -type d + sh: > + echo ./src && + find ./example -maxdepth 1 -mindepth 1 -type d + | grep -vE '(_build|.mooncakes)' EXAMPLES: - sh: find ./example -maxdepth 1 -mindepth 1 -type d + sh: > + find ./example -maxdepth 1 -mindepth 1 -type d + | grep -vE '(_build|.mooncakes)' tasks: release: diff --git a/example/audio/firefly.toml b/example/audio/firefly.toml index 7699051..ade3259 100644 --- a/example/audio/firefly.toml +++ b/example/audio/firefly.toml @@ -6,6 +6,7 @@ author_id = "demo" app_id = "moonbit-audio" author_name = "Demo" app_name = "Audio demo (MoonBit)" +lang = "moon" [files] -pickupCoin = { path = "assets/pickupCoin.wav"} +pickupCoin = { path = "assets/pickupCoin.wav" } diff --git a/example/audio/moon.mod b/example/audio/moon.mod new file mode 100644 index 0000000..1f6f5c9 --- /dev/null +++ b/example/audio/moon.mod @@ -0,0 +1,7 @@ +name = "example-audio" + +preferred_target = "wasm" + +import { + "firefly/firefly@0.7.0", +} diff --git a/example/audio/moon.mod.json b/example/audio/moon.mod.json deleted file mode 100644 index edc1c21..0000000 --- a/example/audio/moon.mod.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "example-audio", - "deps": { - "firefly/firefly": { - "path": "../.." - } - }, - "preferred-target": "wasm" -} diff --git a/example/font/firefly.toml b/example/font/firefly.toml index 7745638..be52280 100644 --- a/example/font/firefly.toml +++ b/example/font/firefly.toml @@ -6,6 +6,7 @@ author_id = "demo" app_id = "moonbit-font" author_name = "Demo" app_name = "Font demo (MoonBit)" +lang = "moon" [files] font = { path = "assets/eg_6x12.fff" } diff --git a/example/font/moon.mod b/example/font/moon.mod new file mode 100644 index 0000000..a35a83e --- /dev/null +++ b/example/font/moon.mod @@ -0,0 +1,7 @@ +name = "example-font" + +preferred_target = "wasm" + +import { + "firefly/firefly@0.7.0", +} diff --git a/example/font/moon.mod.json b/example/font/moon.mod.json deleted file mode 100644 index 6025ef8..0000000 --- a/example/font/moon.mod.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "example-font", - "deps": { - "firefly/firefly": { - "path": "../.." - } - }, - "preferred-target": "wasm" -} diff --git a/example/image/firefly.toml b/example/image/firefly.toml index f0b9e8a..a9ca957 100644 --- a/example/image/firefly.toml +++ b/example/image/firefly.toml @@ -6,6 +6,7 @@ author_id = "demo" app_id = "moonbit-image" author_name = "Demo" app_name = "Image demo (MoonBit)" +lang = "moon" [files] smile1 = { path = "assets/smile-1.png" } diff --git a/example/image/moon.mod b/example/image/moon.mod new file mode 100644 index 0000000..bf765f1 --- /dev/null +++ b/example/image/moon.mod @@ -0,0 +1,7 @@ +name = "example-image" + +preferred_target = "wasm" + +import { + "firefly/firefly@0.7.0", +} diff --git a/example/image/moon.mod.json b/example/image/moon.mod.json deleted file mode 100644 index a7097d6..0000000 --- a/example/image/moon.mod.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "example-image", - "deps": { - "firefly/firefly": { - "path": "../.." - } - }, - "preferred-target": "wasm" -} diff --git a/example/input/firefly.toml b/example/input/firefly.toml index bd1de09..7d77fd1 100644 --- a/example/input/firefly.toml +++ b/example/input/firefly.toml @@ -6,6 +6,7 @@ author_id = "demo" app_id = "moonbit-input" author_name = "Demo" app_name = "Input demo (MoonBit)" +lang = "moon" [files] font = { path = "assets/eg_6x12.fff" } diff --git a/example/input/moon.mod b/example/input/moon.mod new file mode 100644 index 0000000..04b6b6d --- /dev/null +++ b/example/input/moon.mod @@ -0,0 +1,7 @@ +name = "example-input" + +preferred_target = "wasm" + +import { + "firefly/firefly@0.7.0", +} diff --git a/example/input/moon.mod.json b/example/input/moon.mod.json deleted file mode 100644 index 9366c64..0000000 --- a/example/input/moon.mod.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "example-input", - "deps": { - "firefly/firefly": { - "path": "../.." - } - }, - "preferred-target": "wasm" -} diff --git a/example/moon.work b/example/moon.work new file mode 100644 index 0000000..431a1f5 --- /dev/null +++ b/example/moon.work @@ -0,0 +1,3 @@ +members = [ + "..", +] diff --git a/example/random/firefly.toml b/example/random/firefly.toml index d7fb565..3413c66 100644 --- a/example/random/firefly.toml +++ b/example/random/firefly.toml @@ -6,3 +6,4 @@ author_id = "demo" app_id = "moonbit-random" author_name = "Demo" app_name = "Random demo (MoonBit)" +lang = "moon" diff --git a/example/random/moon.mod b/example/random/moon.mod new file mode 100644 index 0000000..7f2328d --- /dev/null +++ b/example/random/moon.mod @@ -0,0 +1,7 @@ +name = "example-random" + +preferred_target = "wasm" + +import { + "firefly/firefly@0.7.0", +} diff --git a/example/random/moon.mod.json b/example/random/moon.mod.json deleted file mode 100644 index 9bff4e9..0000000 --- a/example/random/moon.mod.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "example-random", - "deps": { - "firefly/firefly": { - "path": "../.." - } - }, - "preferred-target": "wasm" -} diff --git a/example/scores/firefly.toml b/example/scores/firefly.toml index 106a973..3f6d666 100644 --- a/example/scores/firefly.toml +++ b/example/scores/firefly.toml @@ -6,6 +6,7 @@ author_id = "demo" app_id = "moonbit-scores" author_name = "Demo" app_name = "Scores demo (MoonBit)" +lang = "moon" [files] font = { path = "assets/eg_6x10.fff" } diff --git a/example/scores/moon.mod b/example/scores/moon.mod new file mode 100644 index 0000000..95245b6 --- /dev/null +++ b/example/scores/moon.mod @@ -0,0 +1,7 @@ +name = "example-scores" + +preferred_target = "wasm" + +import { + "firefly/firefly@0.7.0", +} diff --git a/example/scores/moon.mod.json b/example/scores/moon.mod.json deleted file mode 100644 index 0f871f3..0000000 --- a/example/scores/moon.mod.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "example-scores", - "deps": { - "firefly/firefly": { - "path": "../.." - } - }, - "preferred-target": "wasm" -} diff --git a/example/shapes/firefly.toml b/example/shapes/firefly.toml index f6af6b2..71a2620 100644 --- a/example/shapes/firefly.toml +++ b/example/shapes/firefly.toml @@ -6,3 +6,4 @@ author_id = "demo" app_id = "moonbit-shapes" author_name = "Demo" app_name = "Shapes demo (MoonBit)" +lang = "moon" diff --git a/example/shapes/moon.mod b/example/shapes/moon.mod new file mode 100644 index 0000000..6c1e242 --- /dev/null +++ b/example/shapes/moon.mod @@ -0,0 +1,7 @@ +name = "example-shapes" + +preferred_target = "wasm" + +import { + "firefly/firefly@0.7.0", +} diff --git a/example/shapes/moon.mod.json b/example/shapes/moon.mod.json deleted file mode 100644 index 05889e6..0000000 --- a/example/shapes/moon.mod.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "example-shapes", - "deps": { - "firefly/firefly": { - "path": "../.." - } - }, - "preferred-target": "wasm" -} diff --git a/moon.mod b/moon.mod new file mode 100644 index 0000000..f65e68f --- /dev/null +++ b/moon.mod @@ -0,0 +1,23 @@ +name = "firefly/firefly" + +version = "0.8.0" + +import { + "applejag/micromath@0.3.0", +} + +readme = "README.md" + +repository = "https://github.com/firefly-zero/firefly-moon" + +license = "MIT" + +keywords = [ "game", "firefly-zero" ] + +description = "MoonBit SDK for making Firefly Zero games" + +preferred_target = "wasm" + +options( + source: "src", +) diff --git a/moon.mod.json b/moon.mod.json deleted file mode 100644 index f6cedf3..0000000 --- a/moon.mod.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "firefly/firefly", - "version": "0.8.0", - "deps": { - "applejag/micromath": "0.3.0" - }, - "readme": "README.md", - "repository": "https://github.com/firefly-zero/firefly-moon", - "license": "MIT", - "keywords": ["game", "firefly-zero"], - "description": "MoonBit SDK for making Firefly Zero games", - "source": "src", - "preferred-target": "wasm" -} diff --git a/src/audio/modulators.mbt b/src/audio/modulators.mbt index 84d9d1e..0a763f9 100644 --- a/src/audio/modulators.mbt +++ b/src/audio/modulators.mbt @@ -1,6 +1,6 @@ ///| pub trait Modulator { - modulate(Self, node_id : UInt, param : UInt) -> Unit + fn modulate(Self, node_id : UInt, param : UInt) -> Unit } ///| @@ -20,7 +20,7 @@ pub(all) struct LinearModulator { ///| #inline -pub impl Modulator for LinearModulator with modulate( +pub impl Modulator for LinearModulator with fn modulate( self : LinearModulator, node_id : UInt, param : UInt, @@ -51,7 +51,7 @@ pub(all) struct HoldModulator { ///| #inline -pub impl Modulator for HoldModulator with modulate( +pub impl Modulator for HoldModulator with fn modulate( self : HoldModulator, node_id : UInt, param : UInt, @@ -74,7 +74,7 @@ pub(all) struct SineModulator { ///| #inline -pub impl Modulator for SineModulator with modulate( +pub impl Modulator for SineModulator with fn modulate( self : SineModulator, node_id : UInt, param : UInt, diff --git a/src/audio/node.mbt b/src/audio/node.mbt index ccd42d4..6430c46 100644 --- a/src/audio/node.mbt +++ b/src/audio/node.mbt @@ -6,7 +6,7 @@ struct Node { ///| pub trait Marker { - next(Self) -> Node + fn next(Self) -> Node } ///| @@ -20,7 +20,7 @@ pub struct Sine(Node) ///| /// Get the next node for applying more effects. #inline -pub impl Marker for Sine with next(self : Sine) -> Node { +pub impl Marker for Sine with fn next(self : Sine) -> Node { self.0 } @@ -31,7 +31,7 @@ struct Mix(Node) ///| /// Get the next node for applying more effects. #inline -pub impl Marker for Mix with next(self : Mix) -> Node { +pub impl Marker for Mix with fn next(self : Mix) -> Node { self.0 } @@ -42,7 +42,7 @@ struct AllForOne(Node) ///| /// Get the next node for applying more effects. #inline -pub impl Marker for AllForOne with next(self : AllForOne) -> Node { +pub impl Marker for AllForOne with fn next(self : AllForOne) -> Node { self.0 } @@ -53,7 +53,7 @@ struct Gain(Node) ///| /// Get the next node for applying more effects. #inline -pub impl Marker for Gain with next(self : Gain) -> Node { +pub impl Marker for Gain with fn next(self : Gain) -> Node { self.0 } @@ -64,7 +64,7 @@ struct Loop(Node) ///| /// Get the next node for applying more effects. #inline -pub impl Marker for Loop with next(self : Loop) -> Node { +pub impl Marker for Loop with fn next(self : Loop) -> Node { self.0 } @@ -75,7 +75,7 @@ struct Concat(Node) ///| /// Get the next node for applying more effects. #inline -pub impl Marker for Concat with next(self : Concat) -> Node { +pub impl Marker for Concat with fn next(self : Concat) -> Node { self.0 } @@ -86,7 +86,7 @@ struct Pan(Node) ///| /// Get the next node for applying more effects. #inline -pub impl Marker for Pan with next(self : Pan) -> Node { +pub impl Marker for Pan with fn next(self : Pan) -> Node { self.0 } @@ -97,7 +97,7 @@ struct Mute(Node) ///| /// Get the next node for applying more effects. #inline -pub impl Marker for Mute with next(self : Mute) -> Node { +pub impl Marker for Mute with fn next(self : Mute) -> Node { self.0 } @@ -108,7 +108,7 @@ struct Pause(Node) ///| /// Get the next node for applying more effects. #inline -pub impl Marker for Pause with next(self : Pause) -> Node { +pub impl Marker for Pause with fn next(self : Pause) -> Node { self.0 } @@ -119,7 +119,7 @@ struct TrackPosition(Node) ///| /// Get the next node for applying more effects. #inline -pub impl Marker for TrackPosition with next(self : TrackPosition) -> Node { +pub impl Marker for TrackPosition with fn next(self : TrackPosition) -> Node { self.0 } @@ -130,7 +130,7 @@ struct LowPass(Node) ///| /// Get the next node for applying more effects. #inline -pub impl Marker for LowPass with next(self : LowPass) -> Node { +pub impl Marker for LowPass with fn next(self : LowPass) -> Node { self.0 } @@ -141,7 +141,7 @@ struct HighPass(Node) ///| /// Get the next node for applying more effects. #inline -pub impl Marker for HighPass with next(self : HighPass) -> Node { +pub impl Marker for HighPass with fn next(self : HighPass) -> Node { self.0 } @@ -152,7 +152,7 @@ struct TakeLeft(Node) ///| /// Get the next node for applying more effects. #inline -pub impl Marker for TakeLeft with next(self : TakeLeft) -> Node { +pub impl Marker for TakeLeft with fn next(self : TakeLeft) -> Node { self.0 } @@ -163,7 +163,7 @@ struct TakeRight(Node) ///| /// Get the next node for applying more effects. #inline -pub impl Marker for TakeRight with next(self : TakeRight) -> Node { +pub impl Marker for TakeRight with fn next(self : TakeRight) -> Node { self.0 } @@ -174,7 +174,7 @@ struct Swap(Node) ///| /// Get the next node for applying more effects. #inline -pub impl Marker for Swap with next(self : Swap) -> Node { +pub impl Marker for Swap with fn next(self : Swap) -> Node { self.0 } @@ -185,7 +185,7 @@ struct Clip(Node) ///| /// Get the next node for applying more effects. #inline -pub impl Marker for Clip with next(self : Clip) -> Node { +pub impl Marker for Clip with fn next(self : Clip) -> Node { self.0 } @@ -196,7 +196,7 @@ struct Square(Node) ///| /// Get the next node for applying more effects. #inline -pub impl Marker for Square with next(self : Square) -> Node { +pub impl Marker for Square with fn next(self : Square) -> Node { self.0 } @@ -207,7 +207,7 @@ struct Sawtooth(Node) ///| /// Get the next node for applying more effects. #inline -pub impl Marker for Sawtooth with next(self : Sawtooth) -> Node { +pub impl Marker for Sawtooth with fn next(self : Sawtooth) -> Node { self.0 } @@ -218,7 +218,7 @@ struct Triangle(Node) ///| /// Get the next node for applying more effects. #inline -pub impl Marker for Triangle with next(self : Triangle) -> Node { +pub impl Marker for Triangle with fn next(self : Triangle) -> Node { self.0 } @@ -229,7 +229,7 @@ struct Noise(Node) ///| /// Get the next node for applying more effects. #inline -pub impl Marker for Noise with next(self : Noise) -> Node { +pub impl Marker for Noise with fn next(self : Noise) -> Node { self.0 } @@ -240,7 +240,7 @@ struct Empty(Node) ///| /// Get the next node for applying more effects. #inline -pub impl Marker for Empty with next(self : Empty) -> Node { +pub impl Marker for Empty with fn next(self : Empty) -> Node { self.0 } @@ -251,7 +251,7 @@ struct Zero(Node) ///| /// Get the next node for applying more effects. #inline -pub impl Marker for Zero with next(self : Zero) -> Node { +pub impl Marker for Zero with fn next(self : Zero) -> Node { self.0 } @@ -262,7 +262,7 @@ struct File(Node) ///| /// Get the next node for applying more effects. #inline -pub impl Marker for File with next(self : File) -> Node { +pub impl Marker for File with fn next(self : File) -> Node { self.0 } diff --git a/src/graphics_angle.mbt b/src/graphics_angle.mbt index 2c02a08..1cad8e7 100644 --- a/src/graphics_angle.mbt +++ b/src/graphics_angle.mbt @@ -3,7 +3,7 @@ struct Angle(Float) derive(Debug, Eq, Compare, Hash, Default) ///| -pub impl Show for Angle with output(self : Angle, logger : &Logger) -> Unit { +pub impl Show for Angle with fn output(self : Angle, logger : &Logger) -> Unit { self.to_deg().to_int().output(logger) logger.write_char('°') } @@ -76,31 +76,31 @@ test "angle to degrees" { ///| /// Add together two angles. -pub impl Add for Angle with add(self : Angle, other : Angle) -> Angle { +pub impl Add for Angle with fn add(self : Angle, other : Angle) -> Angle { self.0 + other.0 } ///| /// Subtract one angle from another. -pub impl Sub for Angle with sub(self : Angle, other : Angle) -> Angle { +pub impl Sub for Angle with fn sub(self : Angle, other : Angle) -> Angle { self.0 - other.0 } ///| /// Multiply one angle with another. -pub impl Mul for Angle with mul(self : Angle, other : Angle) -> Angle { +pub impl Mul for Angle with fn mul(self : Angle, other : Angle) -> Angle { self.0 * other.0 } ///| /// Divide one angle with another. -pub impl Div for Angle with div(self : Angle, other : Angle) -> Angle { +pub impl Div for Angle with fn div(self : Angle, other : Angle) -> Angle { self.0 / other.0 } ///| /// Negate an angle -pub impl Neg for Angle with neg(self : Angle) -> Angle { +pub impl Neg for Angle with fn neg(self : Angle) -> Angle { -self.0 } diff --git a/src/graphics_color.mbt b/src/graphics_color.mbt index 59207b4..3870cbf 100644 --- a/src/graphics_color.mbt +++ b/src/graphics_color.mbt @@ -37,12 +37,12 @@ pub(all) enum Color { } derive(Debug, Eq, Compare, Hash) ///| -pub impl Show for Color with output(self : Color, logger : &Logger) -> Unit { +pub impl Show for Color with fn output(self : Color, logger : &Logger) -> Unit { logger.write_string(self.to_string()) } ///| -pub impl Show for Color with to_string(self : Color) -> String { +pub impl Show for Color with fn to_string(self : Color) -> String { match self { None => "none" Black => "black" @@ -65,7 +65,7 @@ pub impl Show for Color with to_string(self : Color) -> String { } ///| -pub impl Default for Color with default() -> Color { +pub impl Default for Color with fn default() -> Color { Color::None } diff --git a/src/graphics_point.mbt b/src/graphics_point.mbt index 08d99f6..db6f779 100644 --- a/src/graphics_point.mbt +++ b/src/graphics_point.mbt @@ -138,19 +138,19 @@ pub fn Point::abs(self : Point) -> Point { ///| /// Add together two points. -pub impl Add for Point with add(self : Point, other : Point) -> Point { +pub impl Add for Point with fn add(self : Point, other : Point) -> Point { { x: self.x + other.x, y: self.y + other.y } } ///| /// Subtract one point from another. -pub impl Sub for Point with sub(self : Point, other : Point) -> Point { +pub impl Sub for Point with fn sub(self : Point, other : Point) -> Point { { x: self.x - other.x, y: self.y - other.y } } ///| /// Negate a Point. -pub impl Neg for Point with neg(self : Point) -> Point { +pub impl Neg for Point with fn neg(self : Point) -> Point { { x: -self.x, y: -self.y } } diff --git a/src/graphics_size.mbt b/src/graphics_size.mbt index fe0074e..8de467e 100644 --- a/src/graphics_size.mbt +++ b/src/graphics_size.mbt @@ -107,12 +107,12 @@ test "Size.component_max" { ///| /// Add together two sizes. -pub impl Add for Size with add(self : Size, other : Size) -> Size { +pub impl Add for Size with fn add(self : Size, other : Size) -> Size { { w: self.w + other.w, h: self.h + other.h } } ///| /// Subtract one size from another. -pub impl Sub for Size with sub(self : Size, other : Size) -> Size { +pub impl Sub for Size with fn sub(self : Size, other : Size) -> Size { { w: self.w - other.w, h: self.h - other.h } } diff --git a/src/input_pad.mbt b/src/input_pad.mbt index 4b03c2e..163c6dd 100644 --- a/src/input_pad.mbt +++ b/src/input_pad.mbt @@ -149,18 +149,18 @@ pub fn Pad::abs(self : Pad) -> Pad { ///| /// Add together two Pads. -pub impl Add for Pad with add(self : Pad, other : Pad) -> Pad { +pub impl Add for Pad with fn add(self : Pad, other : Pad) -> Pad { { x: self.x + other.x, y: self.y + other.y } } ///| /// Subtract one Pad from another. -pub impl Sub for Pad with sub(self : Pad, other : Pad) -> Pad { +pub impl Sub for Pad with fn sub(self : Pad, other : Pad) -> Pad { { x: self.x - other.x, y: self.y - other.y } } ///| /// Negate a Pad. -pub impl Neg for Pad with neg(self : Pad) -> Pad { +pub impl Neg for Pad with fn neg(self : Pad) -> Pad { { x: -self.x, y: -self.y } } diff --git a/src/misc_language.mbt b/src/misc_language.mbt index 517f797..a4ad7ab 100644 --- a/src/misc_language.mbt +++ b/src/misc_language.mbt @@ -29,7 +29,7 @@ pub(all) enum Language { } derive(Debug, Eq, Hash) ///| -pub impl Default for Language with default() -> Language { +pub impl Default for Language with fn default() -> Language { Language::English } diff --git a/src/misc_theme.mbt b/src/misc_theme.mbt index e6138b7..72b10a1 100644 --- a/src/misc_theme.mbt +++ b/src/misc_theme.mbt @@ -13,7 +13,7 @@ pub(all) struct Theme { } derive(Debug, Eq) ///| -pub impl Default for Theme with default() -> Theme { +pub impl Default for Theme with fn default() -> Theme { Theme::{ id: 0, primary: Color::Black, diff --git a/src/net.mbt b/src/net.mbt index f20f429..fa7ec1f 100644 --- a/src/net.mbt +++ b/src/net.mbt @@ -1,7 +1,7 @@ ///| /// A peer obtained either from `Peers` (`get_peers`) or from `get_me`. pub trait AnyPeer { - to_int(self : Self) -> Int + fn to_int(self : Self) -> Int } ///| @@ -17,7 +17,7 @@ struct Me { } derive(Hash) ///| -pub impl AnyPeer for Me with to_int(self : Me) -> Int { +pub impl AnyPeer for Me with fn to_int(self : Me) -> Int { self.raw } @@ -35,12 +35,12 @@ struct Peer { } derive(Eq, Compare, Hash) ///| -pub impl AnyPeer for Peer with to_int(self : Peer) -> Int { +pub impl AnyPeer for Peer with fn to_int(self : Peer) -> Int { self.raw } ///| -pub impl Show for Peer with to_string(self) -> String { +pub impl Show for Peer with fn to_string(self) -> String { match self.raw { 0xFF => "Peer(*)" _ => "Peer(\{self.raw})" @@ -48,7 +48,7 @@ pub impl Show for Peer with to_string(self) -> String { } ///| -pub impl Show for Peer with output(self, logger : &Logger) -> Unit { +pub impl Show for Peer with fn output(self, logger : &Logger) -> Unit { match self.raw { 0xFF => logger.write_string("Peer(*)") _ => { @@ -70,7 +70,7 @@ pub fn Peer::combined() -> Peer { ///| /// `Peer` type default value, which is `Peer::combined`. #inline -pub impl Default for Peer with default() -> Peer { +pub impl Default for Peer with fn default() -> Peer { Peer::combined() } diff --git a/src/shapes/arc.mbt b/src/shapes/arc.mbt index 2f87d4e..fbf2991 100644 --- a/src/shapes/arc.mbt +++ b/src/shapes/arc.mbt @@ -11,7 +11,7 @@ pub(all) struct Arc { ///| /// Draw this arc to the screen (or the current canvas, if one is set). #inline -pub impl Shape for Arc with draw(self : Arc) -> Unit { +pub impl Shape for Arc with fn draw(self : Arc) -> Unit { @firefly.draw_arc( self.point, self.diameter, diff --git a/src/shapes/circle.mbt b/src/shapes/circle.mbt index 1e8ab6c..3837787 100644 --- a/src/shapes/circle.mbt +++ b/src/shapes/circle.mbt @@ -9,7 +9,7 @@ pub(all) struct Circle { ///| /// Draw this circle to the screen (or the current canvas, if one is set). #inline -pub impl Shape for Circle with draw(self : Circle) -> Unit { +pub impl Shape for Circle with fn draw(self : Circle) -> Unit { @firefly.draw_circle(self.point, self.diameter, self.style) } diff --git a/src/shapes/ellipse.mbt b/src/shapes/ellipse.mbt index 973487c..ca07175 100644 --- a/src/shapes/ellipse.mbt +++ b/src/shapes/ellipse.mbt @@ -9,7 +9,7 @@ pub(all) struct Ellipse { ///| /// Draw this ellipse to the screen (or the current canvas, if one is set). #inline -pub impl Shape for Ellipse with draw(self : Ellipse) -> Unit { +pub impl Shape for Ellipse with fn draw(self : Ellipse) -> Unit { @firefly.draw_ellipse(self.point, self.size, self.style) } diff --git a/src/shapes/line.mbt b/src/shapes/line.mbt index 001d855..471aa7b 100644 --- a/src/shapes/line.mbt +++ b/src/shapes/line.mbt @@ -9,6 +9,6 @@ pub(all) struct Line { ///| /// Draw this line to the screen (or the current canvas, if one is set). #inline -pub impl Shape for Line with draw(self : Line) -> Unit { +pub impl Shape for Line with fn draw(self : Line) -> Unit { @firefly.draw_line(self.a, self.b, self.style) } diff --git a/src/shapes/rect.mbt b/src/shapes/rect.mbt index f70ae23..ba6175d 100644 --- a/src/shapes/rect.mbt +++ b/src/shapes/rect.mbt @@ -9,7 +9,7 @@ pub(all) struct Rect { ///| /// Draw this rectangle to the screen (or the current canvas, if one is set). #inline -pub impl Shape for Rect with draw(self : Rect) -> Unit { +pub impl Shape for Rect with fn draw(self : Rect) -> Unit { @firefly.draw_rect(self.point, self.size, self.style) } diff --git a/src/shapes/rounded_rect.mbt b/src/shapes/rounded_rect.mbt index 46bef2e..05bfef7 100644 --- a/src/shapes/rounded_rect.mbt +++ b/src/shapes/rounded_rect.mbt @@ -10,7 +10,7 @@ pub(all) struct RoundedRect { ///| /// Draw this rounded rectangle to the screen (or the current canvas, if one is set). #inline -pub impl Shape for RoundedRect with draw(self : RoundedRect) -> Unit { +pub impl Shape for RoundedRect with fn draw(self : RoundedRect) -> Unit { @firefly.draw_rounded_rect(self.point, self.size, self.corner, self.style) } diff --git a/src/shapes/sector.mbt b/src/shapes/sector.mbt index 61cdc31..6702c84 100644 --- a/src/shapes/sector.mbt +++ b/src/shapes/sector.mbt @@ -11,7 +11,7 @@ pub(all) struct Sector { ///| /// Draw this circle sector to the screen (or the current canvas, if one is set). #inline -pub impl Shape for Sector with draw(self : Sector) -> Unit { +pub impl Shape for Sector with fn draw(self : Sector) -> Unit { @firefly.draw_sector( self.point, self.diameter, diff --git a/src/shapes/top.mbt b/src/shapes/top.mbt index c6fa325..43e9520 100644 --- a/src/shapes/top.mbt +++ b/src/shapes/top.mbt @@ -5,5 +5,5 @@ using @firefly {type Angle, type LineStyle, type Point, type Size, type Style} /// Trait for shapes that can draw to the screen. pub trait Shape { /// Draw this shape to the screen (or the current canvas, if one is set). - draw(Self) -> Unit + fn draw(Self) -> Unit } diff --git a/src/shapes/triangle.mbt b/src/shapes/triangle.mbt index 045425c..d9046bf 100644 --- a/src/shapes/triangle.mbt +++ b/src/shapes/triangle.mbt @@ -10,6 +10,6 @@ pub(all) struct Triangle { ///| /// Draw this triangle to the screen (or the current canvas, if one is set). #inline -pub impl Shape for Triangle with draw(self : Triangle) -> Unit { +pub impl Shape for Triangle with fn draw(self : Triangle) -> Unit { @firefly.draw_triangle(self.a, self.b, self.c, self.style) }