-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
time to rename every module for some reason
- Loading branch information
Showing
87 changed files
with
784 additions
and
708 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{-| | ||
Module : Yaifl.Model.Effects | ||
Module : Yaifl.Core.Effects | ||
Copyright : (c) Avery 2023-2024 | ||
License : MIT | ||
Maintainer : [email protected] | ||
|
@@ -8,7 +8,7 @@ Effects for getting, setting, modifying, traversing over the `Object` collection | |
type synonyms for bundling common constraints together. | ||
-} | ||
|
||
module Yaifl.Model.Effects | ||
module Yaifl.Core.Effects | ||
( -- * Effects | ||
ObjectLookup(..) | ||
, lookupThing | ||
|
@@ -39,12 +39,12 @@ import Breadcrumbs | |
import Effectful.Error.Static | ||
import Effectful.TH | ||
|
||
import Yaifl.Model.Metadata | ||
import Yaifl.Model.Entity | ||
import Yaifl.Core.Metadata | ||
import Yaifl.Core.Entity | ||
import Yaifl.Model.WorldModel | ||
import Yaifl.Model.Kinds.Region | ||
import Yaifl.Model.Kinds.Thing | ||
import Yaifl.Model.Kinds.Room | ||
import Yaifl.Core.Kinds.Thing | ||
import Yaifl.Core.Kinds.Room | ||
|
||
-- | Effect for reading objects from the world. | ||
data ObjectLookup (wm :: WorldModel) :: Effect where | ||
|
@@ -89,7 +89,6 @@ type NoMissingObjects wm es = (WithMetadata es, Error MissingObject :> es, Objec | |
-- | Type synonym for reading objects with a way to handle missing IDs. | ||
type NoMissingRead wm es = (Error MissingObject :> es, ObjectLookup wm :> es, WithMetadata es) | ||
|
||
|
||
withoutMissingObjects :: | ||
HasCallStack | ||
=> (HasCallStack => Eff (Error MissingObject ': es) a) -- ^ the block | ||
|
7 changes: 5 additions & 2 deletions
7
yaifl/src/Yaifl/Model/Entity.hs → yaifl/src/Yaifl/Core/Entity.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
{-| | ||
Module : Yaifl.Model.Entity | ||
Module : Yaifl.Core.Entity | ||
Copyright : (c) Avery 2022-2023 | ||
License : MIT | ||
Maintainer : [email protected] | ||
Object IDs. | ||
-} | ||
|
||
module Yaifl.Model.Entity | ||
module Yaifl.Core.Entity | ||
( -- * Entities | ||
Entity(..) | ||
, HasID(..) | ||
, TaggedEntity(unTag) | ||
, unsafeTagEntity | ||
-- ** Tags | ||
-- These are here because these ones are foundational enough that they need to be | ||
-- forward-declared (things and rooms are foundational, enclosing is required for rooms, | ||
-- doors are required for room connections, person is needed for the current player in metadata) | ||
, ThingTag | ||
, ThingEntity | ||
, RoomTag | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
{-| | ||
Module : Yaifl.Model.HasProperty | ||
Copyright : (c) Avery 2023 | ||
Module : Yaifl.Core.HasProperty | ||
Copyright : (c) Avery 2023-2024 | ||
License : MIT | ||
Maintainer : [email protected] | ||
Optics for accessing a property from the sum type of object specifics. | ||
-} | ||
|
||
module Yaifl.Model.HasProperty ( | ||
module Yaifl.Core.HasProperty ( | ||
-- * Has | ||
MayHaveProperty(..) | ||
, WMWithProperty | ||
) where | ||
|
||
import Yaifl.Prelude | ||
import Yaifl.Model.WorldModel ( WMObjSpecifics ) | ||
|
||
-- | An `AffineTraversal` is an optic that focuses on 0-1 objects; it's a `Prism` without | ||
-- the condition that you can build it back up again..which works great for the possibility | ||
|
@@ -36,7 +34,4 @@ instance MayHaveProperty a v => MayHaveProperty (Maybe a) v where | |
Just y -> Right y) | ||
(\case | ||
Nothing -> const Nothing | ||
Just a -> \v -> Just $ a & propertyAT .~ v) | ||
|
||
-- | A helper to define that a world model @wm@ has a Property. | ||
type WMWithProperty wm v = MayHaveProperty (WMObjSpecifics wm) v | ||
Just a -> \v -> Just $ a & propertyAT .~ v) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
{-| | ||
Module : Yaifl.Model.Kinds.Enclosing | ||
Module : Yaifl.Core.Kinds.Enclosing | ||
Copyright : (c) Avery 2023 | ||
License : MIT | ||
Maintainer : [email protected] | ||
A property component for things that can contain other things (rooms, supporters, containers, etc). | ||
-} | ||
|
||
module Yaifl.Model.Kinds.Enclosing ( | ||
module Yaifl.Core.Kinds.Enclosing ( | ||
-- * Enclosing | ||
Enclosing(..) | ||
, blankEnclosing | ||
|
@@ -16,8 +16,8 @@ module Yaifl.Model.Kinds.Enclosing ( | |
import Yaifl.Prelude | ||
|
||
import Data.EnumSet ( EnumSet, empty ) | ||
import Yaifl.Model.Entity | ||
import Yaifl.Model.Tag | ||
import Yaifl.Core.Entity | ||
import Yaifl.Core.Tag | ||
|
||
-- | A component that contains other objects. | ||
data Enclosing = Enclosing | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
{-| | ||
Module : Yaifl.Model.Kinds.Object | ||
Module : Yaifl.Core.Kinds.Object | ||
Copyright : (c) Avery 2023-2024 | ||
License : MIT | ||
Maintainer : [email protected] | ||
A game object (a thing or a room). | ||
-} | ||
|
||
module Yaifl.Model.Kinds.Object ( | ||
module Yaifl.Core.Kinds.Object ( | ||
-- * Pointed sets | ||
Pointed(..) | ||
-- * Objects | ||
|
@@ -25,7 +25,7 @@ module Yaifl.Model.Kinds.Object ( | |
) where | ||
|
||
import Yaifl.Prelude | ||
import Yaifl.Model.Entity | ||
import Yaifl.Core.Entity | ||
import Yaifl.Model.WorldModel (WMText) | ||
|
||
-- | If the object has a pluralised name. | ||
|
@@ -40,7 +40,7 @@ data NameProperness = Improper | Proper | |
data NamePrivacy = PrivatelyNamed | PubliclyNamed | ||
deriving stock (Show, Eq, Ord, Bounded, Enum, Generic, Read) | ||
|
||
-- | See also `Yaifl.Model.Metadata.typeDAG`. An object type is just a string that has some relations to other types. | ||
-- | See also `Yaifl.Core.Metadata.typeDAG`. An object type is just a string that has some relations to other types. | ||
-- there is no data or polymorphism connected to a type, so it's very possible to call something a supporter without | ||
-- having some supporter properties. | ||
newtype ObjectKind = ObjectKind | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.