Created
July 9, 2017 09:08
-
-
Save allansideas/4e206abab9b158c6eb03c0714d5aa277 to your computer and use it in GitHub Desktop.
Circular dependency troubles
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
module Msg exposing (..) | |
import Types exposing (StoryNode, Transition) | |
type Msg | |
= NoOp | |
| Start | |
| TestStory | |
| NewStoryNode StoryNode | |
| TransitionStoryNode Transition |
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
module Types exposing (..) | |
import Html exposing (Html) | |
import Msg exposing (..) | |
type alias StoryNode = | |
{ id : Int | |
, nodeType : NodeType | |
, nodeContent : StoryNodeContent | |
, state : Maybe String | |
, transitions : List Transition | |
} | |
type NodeType | |
= NewsNode | |
| ChatNode | |
type StoryNodeContent | |
= NewsItemContent NewsItem | |
| ChatMessageContent ChatMessage | |
type alias NewsItem = | |
{ id : Int | |
, content : List (Html Msg) | |
} | |
type alias ChatMessage = | |
{ id : Int | |
, chatId : Int | |
, userId : Int | |
, content : List (Html Msg) | |
} | |
type alias Player = | |
{ visitedStoryNodes : List StoryNode | |
, currentStoryNode : Maybe StoryNode | |
} | |
type alias Transition = | |
{ transitionType : String, toStoryNode : Int, text : Maybe String } | |
type alias Model = | |
{ player : Player | |
, nodes : List StoryNode | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment