gamefic 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gamefic.rb +4 -1
- data/lib/gamefic/action.rb +4 -0
- data/lib/gamefic/{character.rb → active.rb} +280 -232
- data/lib/gamefic/actor.rb +5 -0
- data/lib/gamefic/core_ext/string.rb +12 -12
- data/lib/gamefic/describable.rb +18 -1
- data/lib/gamefic/element.rb +31 -0
- data/lib/gamefic/engine/base.rb +17 -24
- data/lib/gamefic/entity.rb +18 -36
- data/lib/gamefic/grammar/gender.rb +1 -1
- data/lib/gamefic/grammar/pronouns.rb +3 -2
- data/lib/gamefic/messaging.rb +0 -1
- data/lib/gamefic/plot.rb +14 -4
- data/lib/gamefic/plot/callbacks.rb +1 -2
- data/lib/gamefic/plot/commands.rb +3 -4
- data/lib/gamefic/plot/darkroom.rb +264 -0
- data/lib/gamefic/plot/entities.rb +13 -1
- data/lib/gamefic/plot/host.rb +10 -8
- data/lib/gamefic/plot/playbook.rb +17 -13
- data/lib/gamefic/plot/scenes.rb +50 -12
- data/lib/gamefic/plot/snapshot.rb +15 -210
- data/lib/gamefic/query.rb +1 -0
- data/lib/gamefic/query/base.rb +15 -19
- data/lib/gamefic/query/external.rb +14 -0
- data/lib/gamefic/scene.rb +2 -4
- data/lib/gamefic/scene/{active.rb → activity.rb} +26 -26
- data/lib/gamefic/scene/base.rb +12 -7
- data/lib/gamefic/scene/multiple_choice.rb +0 -13
- data/lib/gamefic/scene/multiple_scene.rb +1 -1
- data/lib/gamefic/subplot.rb +16 -23
- data/lib/gamefic/user.rb +0 -1
- data/lib/gamefic/user/base.rb +15 -1
- data/lib/gamefic/user/tty.rb +15 -31
- data/lib/gamefic/version.rb +1 -1
- metadata +8 -26
- data/lib/gamefic/character/state.rb +0 -12
- data/lib/gamefic/user/buffer.rb +0 -32
data/lib/gamefic/user/buffer.rb
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
module Gamefic
|
2
|
-
|
3
|
-
# A simple buffer class for collecting and returning data received from
|
4
|
-
# plots.
|
5
|
-
class User::Buffer
|
6
|
-
def initialize
|
7
|
-
@data = ''
|
8
|
-
end
|
9
|
-
|
10
|
-
# Append a message to the buffer.
|
11
|
-
def send message
|
12
|
-
@data += message
|
13
|
-
end
|
14
|
-
|
15
|
-
# Read the current buffer without clearing it.
|
16
|
-
#
|
17
|
-
# @return [String]
|
18
|
-
def peek
|
19
|
-
@data
|
20
|
-
end
|
21
|
-
|
22
|
-
# Get the current data and clear the buffer.
|
23
|
-
#
|
24
|
-
# @return [String]
|
25
|
-
def flush
|
26
|
-
tmp = @data
|
27
|
-
@data = ''
|
28
|
-
tmp
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|