diff options
author | Griffin Smith <root@gws.fyi> | 2019-07-07T16·41-0400 |
---|---|---|
committer | Griffin Smith <root@gws.fyi> | 2019-07-07T16·41-0400 |
commit | c643ee1dfcb8d44b8cd198c768f31dd7659f2ff9 (patch) | |
tree | 8178c613e55c00944a6417a85ad304cf2af05587 /src/types/mod.rs | |
parent | 78a52142d191d25a74cb2124d5cca8a69d51ba7f (diff) |
Add messages, with global lookup map
Add support for messages, along with a global lookup map and random choice of messages.
Diffstat (limited to 'src/types/mod.rs')
-rw-r--r-- | src/types/mod.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/types/mod.rs b/src/types/mod.rs index 146dfac9d99b..ab66a50cc218 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -66,6 +66,12 @@ impl BoundingBox { pub fn inner(self) -> BoundingBox { self + UNIT_POSITION - UNIT_DIMENSIONS - UNIT_DIMENSIONS } + + /// Moves the top right corner of the bounding box by the offset specified + /// by the given position, keeping the lower right corner in place + pub fn move_tr_corner(self, offset: Position) -> BoundingBox { + self + offset - Dimensions { w: offset.x as u16, h: offset.y as u16 } + } } impl ops::Add<Position> for BoundingBox { |