Firelights: Refactoring cards deck, adding StoryNode(s) and improving stories storage.
This commit is contained in:
parent
02d36190c2
commit
f2a5a74ca8
@ -1,10 +1,10 @@
|
||||
accessing
|
||||
initialize
|
||||
cards
|
||||
| response |
|
||||
response := self new.
|
||||
response := OrderedCollection new.
|
||||
self suits keysDo: [:suit |
|
||||
(self numeralCards, self faceCards) do: [:number|
|
||||
response cards add: number asString, suit.
|
||||
response add: number asString, suit.
|
||||
].
|
||||
].
|
||||
^ response
|
@ -1,3 +0,0 @@
|
||||
accessing
|
||||
cards: aCollection
|
||||
cards := aCollection
|
@ -1,3 +1,3 @@
|
||||
accessing
|
||||
cards
|
||||
^ cards ifNil: [ cards := OrderedCollection new]
|
||||
^ self class cards
|
@ -1,5 +1,5 @@
|
||||
accessing
|
||||
reset
|
||||
self drawn: OrderedCollection new.
|
||||
self cards: self class initialize cards.
|
||||
self stock: self class cards.
|
||||
^ self
|
@ -1,3 +1,3 @@
|
||||
accessing
|
||||
stock
|
||||
^ stock := self cards copyWithoutAll: self drawn
|
||||
^ stock := self class cards copyWithoutAll: self drawn
|
@ -6,7 +6,6 @@
|
||||
"pools" : [ ],
|
||||
"classvars" : [ ],
|
||||
"instvars" : [
|
||||
"cards",
|
||||
"drawn",
|
||||
"stock"
|
||||
],
|
||||
|
3
RoloLudo.package/FirelightsGame.class/instance/deck..st
Normal file
3
RoloLudo.package/FirelightsGame.class/instance/deck..st
Normal file
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
deck: anObject
|
||||
deck := anObject
|
@ -1,3 +1,3 @@
|
||||
accessing
|
||||
deck
|
||||
^ deck ifNil: [ deck := DeckOfCards initialize]
|
||||
^ deck ifNil: [ deck := DeckOfCards new]
|
10
RoloLudo.package/FirelightsGame.class/instance/export.st
Normal file
10
RoloLudo.package/FirelightsGame.class/instance/export.st
Normal file
@ -0,0 +1,10 @@
|
||||
accessing
|
||||
export
|
||||
| response |
|
||||
response := '' writeStream.
|
||||
(STON writer on: response)
|
||||
newLine: String lf;
|
||||
prettyPrint: true;
|
||||
keepNewLines: true;
|
||||
nextPut: self.
|
||||
^ MarkupFile exportAsFileOn: FileLocator temp / 'firelights.ston' containing: (response contents)
|
@ -0,0 +1,4 @@
|
||||
accessing
|
||||
resetWorlMap
|
||||
self worldMap: nil.
|
||||
self deck reset.
|
3
RoloLudo.package/FirelightsGame.class/instance/story..st
Normal file
3
RoloLudo.package/FirelightsGame.class/instance/story..st
Normal file
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
story: anObject
|
||||
story := anObject
|
3
RoloLudo.package/FirelightsGame.class/instance/story.st
Normal file
3
RoloLudo.package/FirelightsGame.class/instance/story.st
Normal file
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
story
|
||||
^ story ifNil: [ story := OrderedCollection new]
|
13
RoloLudo.package/FirelightsGame.class/instance/uiGameFor..st
Normal file
13
RoloLudo.package/FirelightsGame.class/instance/uiGameFor..st
Normal file
@ -0,0 +1,13 @@
|
||||
accessing
|
||||
uiGameFor: aView
|
||||
<gtView>
|
||||
| response |
|
||||
response := '' writeStream.
|
||||
response
|
||||
nextPutAll: '❭❭❭ Main Character'; cr; cr;
|
||||
nextPutAll: self characters first printString; cr;
|
||||
nextPutAll: '❭❭❭ Deck'; cr; cr;
|
||||
nextPutAll: self deck printString.
|
||||
^ aView text
|
||||
title: 'Game';
|
||||
text: [ response contents ]
|
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
worldMap: anObject
|
||||
wordMap := anObject
|
@ -0,0 +1,5 @@
|
||||
accessing
|
||||
worldMapDraw: aCardCollection
|
||||
self deck drawn addAll: aCardCollection.
|
||||
self worldMap addAll: aCardCollection.
|
||||
|
@ -11,7 +11,8 @@
|
||||
"wordMap",
|
||||
"oracles",
|
||||
"wiki",
|
||||
"characters"
|
||||
"characters",
|
||||
"story"
|
||||
],
|
||||
"name" : "FirelightsGame",
|
||||
"type" : "normal"
|
||||
|
0
RoloLudo.package/StoryNode.class/README.md
Normal file
0
RoloLudo.package/StoryNode.class/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
addCharacter: aCharacter
|
||||
self characters add: aCharacter
|
3
RoloLudo.package/StoryNode.class/instance/addPlace..st
Normal file
3
RoloLudo.package/StoryNode.class/instance/addPlace..st
Normal file
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
addPlace: aPlaceCard
|
||||
self places add: aPlaceCard
|
3
RoloLudo.package/StoryNode.class/instance/characters.st
Normal file
3
RoloLudo.package/StoryNode.class/instance/characters.st
Normal file
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
characters
|
||||
^ characters ifNil: [ characters := Set new]
|
3
RoloLudo.package/StoryNode.class/instance/places.st
Normal file
3
RoloLudo.package/StoryNode.class/instance/places.st
Normal file
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
places
|
||||
^ places ifNil: [ places := Set new]
|
3
RoloLudo.package/StoryNode.class/instance/text..st
Normal file
3
RoloLudo.package/StoryNode.class/instance/text..st
Normal file
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
text: aString
|
||||
text := aString
|
3
RoloLudo.package/StoryNode.class/instance/text.st
Normal file
3
RoloLudo.package/StoryNode.class/instance/text.st
Normal file
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
text
|
||||
^ text
|
16
RoloLudo.package/StoryNode.class/properties.json
Normal file
16
RoloLudo.package/StoryNode.class/properties.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"commentStamp" : "",
|
||||
"super" : "Object",
|
||||
"category" : "RoloLudo",
|
||||
"classinstvars" : [ ],
|
||||
"pools" : [ ],
|
||||
"classvars" : [ ],
|
||||
"instvars" : [
|
||||
"text",
|
||||
"characters",
|
||||
"places",
|
||||
"inspirations"
|
||||
],
|
||||
"name" : "StoryNode",
|
||||
"type" : "normal"
|
||||
}
|
Loading…
Reference in New Issue
Block a user