gameon 0.0.0.pre3 → 0.0.0.pre4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4deadf1c61f76193e4e2b1129580e77cefe7cc32
4
- data.tar.gz: 13e7cd4a7aaebf1ae0b04a6a9c0ee57a096b96a9
3
+ metadata.gz: 06bd08f1a0616e11a0265f6fd0c8005f6b996127
4
+ data.tar.gz: 857d9c57c2f40882ad0b4e09c87e138989a2dae1
5
5
  SHA512:
6
- metadata.gz: 110d6a221739c3e7da49336d382e55f861fb66eb598c828f96d8a3f8f3815a37eedc3d06f1082ece1f94ffeedd4b903ca00c93292accc6b97b9594f9e8deb8c2
7
- data.tar.gz: 1e7a7d6ad8807a45f415ccdbc70a0b7f2690653ea1e6fd83b52ef8a9e860d6abfcf533c89373fc309f757f85a7806301d9178c1f8bf9e351911861aee79285ce
6
+ metadata.gz: cab3c669d40ad1c14d5cf28f8ad84cee78e4b09b709f5e74e56b3b443f5e90309bd34508fb47b770950d2b2611344c93b3b061ca0345a23ff2885fe0729dc3cd
7
+ data.tar.gz: 532b737f8d88444e0a4fceb5678a28a3a24f2baaafa83e1a14c5b965bc29564b83be50b45d722af80129b0941ab1d1fcea9239d6bbd49b79e09081aa63ef119e
@@ -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,13 @@
1
+ module GameOn
2
+ module Gamebook
3
+ class Dynamic
4
+ attr_accessor :name, :opts, :params
5
+ def initialize name, opts={}, params={}
6
+ @name = name
7
+ @opts = opts
8
+ @params = params
9
+ end
10
+
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,18 @@
1
+ module GameOn
2
+ module Gamebook
3
+ class Game
4
+ attr_accessor :title, :rules
5
+ def initialize title
6
+ @title = title
7
+ @rules = []
8
+ end
9
+ def add_rule rule
10
+ @rules += [rule]
11
+ end
12
+
13
+ def rules
14
+ @rules
15
+ end
16
+ end
17
+ end
18
+ 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
@@ -0,0 +1,3 @@
1
+ module Gameon
2
+ VERSION = "0.0.0.pre2"
3
+ 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.pre3
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