gameon 0.0.0.pre3 → 0.0.0.pre4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gameon/base.rb +62 -0
- data/lib/gameon/gamebook/dynamic.rb +13 -0
- data/lib/gameon/gamebook/game.rb +18 -0
- data/lib/gameon/gamebook/rule.rb +20 -0
- data/lib/gameon/version.rb +3 -0
- metadata +6 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06bd08f1a0616e11a0265f6fd0c8005f6b996127
|
4
|
+
data.tar.gz: 857d9c57c2f40882ad0b4e09c87e138989a2dae1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cab3c669d40ad1c14d5cf28f8ad84cee78e4b09b709f5e74e56b3b443f5e90309bd34508fb47b770950d2b2611344c93b3b061ca0345a23ff2885fe0729dc3cd
|
7
|
+
data.tar.gz: 532b737f8d88444e0a4fceb5678a28a3a24f2baaafa83e1a14c5b965bc29564b83be50b45d722af80129b0941ab1d1fcea9239d6bbd49b79e09081aa63ef119e
|
data/lib/gameon/base.rb
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
require_relative './gamebook/game'
|
2
|
+
require_relative './gamebook/rule'
|
3
|
+
require_relative './gamebook/dynamic'
|
4
|
+
|
5
|
+
|
6
|
+
module GameOn
|
7
|
+
def GameOn.env id
|
8
|
+
require 'redis'
|
9
|
+
@@redis = Redis.new
|
10
|
+
Marshal.load @@redis.get id
|
11
|
+
#p env[:gameon].id
|
12
|
+
end
|
13
|
+
|
14
|
+
class Env < Mushin::Env
|
15
|
+
end
|
16
|
+
|
17
|
+
module Gamebook
|
18
|
+
extend Mushin::DSL::Notebook
|
19
|
+
@@constructs = []
|
20
|
+
# this is Mandatory as the .find funtion in DSL::Notebook needs it
|
21
|
+
@@games = []
|
22
|
+
def game title, &block
|
23
|
+
@@game = GameOn::Gamebook::Game.new title
|
24
|
+
def rule rule=[], &block
|
25
|
+
@rule = GameOn::Gamebook::Rule.new rule
|
26
|
+
def activate dynamic, opts={}, params={}
|
27
|
+
@dynamic = GameOn::Gamebook::Dynamic.new dynamic, opts, params
|
28
|
+
@rule.add_dynamic @dynamic
|
29
|
+
end
|
30
|
+
@@game.add_rule @rule
|
31
|
+
yield
|
32
|
+
end
|
33
|
+
yield
|
34
|
+
@@games << @@game
|
35
|
+
@@constructs = @@games
|
36
|
+
end
|
37
|
+
def Gamebook.games
|
38
|
+
@@games
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
class Activities < Mushin::DSL::Activities
|
43
|
+
#include Mushin::DSL::Activities
|
44
|
+
#extend Mushin::DSL::Activities
|
45
|
+
def self.construction game, activity
|
46
|
+
GameOn::Engine.run game, activity
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
module Engine
|
51
|
+
def Engine.run game, activity
|
52
|
+
#[Mushin::Presistence::DS, Mushin::blahblah]
|
53
|
+
#use Mushin::Persistence::DS
|
54
|
+
#Mushin::Engine.setup do
|
55
|
+
#['some entity middleware','some datastore']
|
56
|
+
#use Mushin::DS.blaa and then class_eval there
|
57
|
+
#end
|
58
|
+
Mushin::Engine.setup [GameOn::Persistence::DS]
|
59
|
+
Mushin::Engine.run game, activity
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module GameOn
|
2
|
+
module Gamebook
|
3
|
+
class Rule
|
4
|
+
attr_accessor :title, :dynamix
|
5
|
+
def initialize title
|
6
|
+
@title = title
|
7
|
+
@dynamix = []
|
8
|
+
end
|
9
|
+
|
10
|
+
def add_dynamic dynamic
|
11
|
+
@dynamix += [dynamic]
|
12
|
+
end
|
13
|
+
|
14
|
+
def all_dynamix
|
15
|
+
@dynamix
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gameon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.0.
|
4
|
+
version: 0.0.0.pre4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- theotherstupidguy
|
@@ -60,6 +60,11 @@ extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
62
|
- lib/gameon.rb
|
63
|
+
- lib/gameon/base.rb
|
64
|
+
- lib/gameon/gamebook/dynamic.rb
|
65
|
+
- lib/gameon/gamebook/game.rb
|
66
|
+
- lib/gameon/gamebook/rule.rb
|
67
|
+
- lib/gameon/version.rb
|
63
68
|
homepage: https://github.com/gameon-rb/gameon
|
64
69
|
licenses:
|
65
70
|
- MIT
|