spy_alley_application 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +72 -6
- data/lib/spy_alley_application/version.rb +1 -1
- data/spy_alley_application.gemspec +9 -9
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51d7a160db3dd8f988a34c01b9c6db7602c40e1f21077f4edf9596c545c79ca0
|
4
|
+
data.tar.gz: f34ce4a22aa442faf10700e5321a79e74b1f526a978d75f505905d9494898c8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59459b4bc725c52991c2b6bd9685d05812ccf6d9fb9ca850f3f5229c1bca88c93ac0ed114e1dab35cedda9561f6fd13f758a3e0990c6d995f437a84730c67054
|
7
|
+
data.tar.gz: 8492bf6951da16e712f90d7280e8e6d549ac5be4fa6552bec712075ee5c9bd463db3fb135fd9e3154b597415768c5e16ef6a15b4789a2b4ca4514e02ce4d6adc
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# SpyAlleyApplication
|
2
2
|
|
3
3
|
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/roda/spy_alley_application`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
4
|
|
@@ -9,7 +9,7 @@ TODO: Delete this and the text above, and describe your gem
|
|
9
9
|
Add this line to your application's Gemfile:
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
gem '
|
12
|
+
gem 'spy_alley_application'
|
13
13
|
```
|
14
14
|
|
15
15
|
And then execute:
|
@@ -18,11 +18,77 @@ And then execute:
|
|
18
18
|
|
19
19
|
Or install it yourself as:
|
20
20
|
|
21
|
-
$ gem install
|
21
|
+
$ gem install spy_alley_application
|
22
22
|
|
23
|
-
##
|
23
|
+
## SpyAlleyApplication::NewGame
|
24
|
+
```
|
25
|
+
require 'spy_alley_application/new_game'
|
26
|
+
new_game = SpyAlleyApplication::NewGame
|
27
|
+
```
|
28
|
+
You call it with an Array of Hashes with ids and seats (that must all be distinct)
|
29
|
+
```
|
30
|
+
new_game.(action_hash: {seat_assignments: [{id: 1, seat: 1}, {id: 2, seat: 2}]}, user: nil)
|
31
|
+
```
|
32
|
+
## SpyAlleyApplication::ExecuteAction
|
33
|
+
```
|
34
|
+
require 'spy_alley_application/execute_action'
|
35
|
+
execute_action = SpyAlleyApplication::ExecuteAction
|
36
|
+
```
|
24
37
|
|
25
|
-
|
38
|
+
### game_board format
|
39
|
+
players: (array of)
|
40
|
+
id: 1,
|
41
|
+
seat: 1,
|
42
|
+
location: {id: 0},
|
43
|
+
spy_identity: "spanish",
|
44
|
+
money: 20,
|
45
|
+
move cards: [1,2],
|
46
|
+
equipment: ["german password", "german key"],
|
47
|
+
wild_cards: 0,
|
48
|
+
active?: true
|
49
|
+
move_card_pile: [1,3,2,5,6...]
|
50
|
+
free_gift_pile: ["russian password", "german key", "wild card"...]
|
51
|
+
game_state:
|
52
|
+
name: "start_of_turn",
|
53
|
+
seat: 1
|
54
|
+
|
55
|
+
<b>action_hash</b>
|
56
|
+
Legal options:
|
57
|
+
player_action:
|
58
|
+
- roll_die
|
59
|
+
- use_move_card
|
60
|
+
- make_accusation
|
61
|
+
- move
|
62
|
+
- buy_equipment
|
63
|
+
- confiscate_materials
|
64
|
+
- choose_new_spy_identity
|
65
|
+
- pass
|
66
|
+
equipment_to_buy: # only required if player_action = 'buy_equipment' (send an array of strings)
|
67
|
+
- russian password
|
68
|
+
- german key
|
69
|
+
and so on
|
70
|
+
equipment_to_confiscate: # only required if player_action = 'buy_equipment' (send a single string)
|
71
|
+
- russian password
|
72
|
+
- german key
|
73
|
+
and so on
|
74
|
+
card_to_use: {1, 2, 3, 4, 5, 6} # required if player_action = 'use_move_card' (a single value)
|
75
|
+
space_id: {0, 1...30, 31} # required if player_action = 'move'
|
76
|
+
target_player_id: {1...} # required if player_action = 'make_accusation' or 'confiscate_materials'
|
77
|
+
nationality: # required if player_action = 'make_accusation' or 'choose_new_spy_identity'
|
78
|
+
- french
|
79
|
+
- german
|
80
|
+
- spanish
|
81
|
+
- italian
|
82
|
+
- american
|
83
|
+
- russian
|
84
|
+
|
85
|
+
### user
|
86
|
+
User is an object calculated by users of this project that quack with the following interface
|
87
|
+
id() # the id of the user
|
88
|
+
admin?() # true or false dependending on whether the user is an admin
|
89
|
+
|
90
|
+
### last_action_id
|
91
|
+
the action_id of the last completed action. The action hash should fail to validate if it doesn't match the action_id in the action_hash
|
26
92
|
|
27
93
|
## Development
|
28
94
|
|
@@ -32,7 +98,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
98
|
|
33
99
|
## Contributing
|
34
100
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
101
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/cmcolinh/spy_alley_application.
|
36
102
|
|
37
103
|
## License
|
38
104
|
|
@@ -2,7 +2,7 @@ lib = File.expand_path("lib", __dir__)
|
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
3
|
require "spy_alley_application/version"
|
4
4
|
|
5
|
-
Gem::Specification.new 'spy_alley_application', '0.3.
|
5
|
+
Gem::Specification.new 'spy_alley_application', '0.3.1' do |spec|
|
6
6
|
spec.name = 'spy_alley_application'
|
7
7
|
spec.version = SpyAlleyApplication::VERSION
|
8
8
|
spec.authors = ['Colin Horner']
|
@@ -27,14 +27,14 @@ Gem::Specification.new 'spy_alley_application', '0.3.0' do |spec|
|
|
27
27
|
spec.require_paths = ["lib"]
|
28
28
|
|
29
29
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
30
|
-
spec.
|
31
|
-
spec.
|
32
|
-
spec.
|
33
|
-
spec.
|
34
|
-
spec.
|
35
|
-
spec.
|
36
|
-
spec.
|
37
|
-
spec.
|
30
|
+
spec.add_dependency 'change_orders', '~> 0.1.0'
|
31
|
+
spec.add_dependency 'dry-auto_inject'
|
32
|
+
spec.add_dependency 'dry-initializer'
|
33
|
+
spec.add_dependency 'dry-monads'
|
34
|
+
spec.add_dependency 'dry-struct'
|
35
|
+
spec.add_dependency 'dry-types'
|
36
|
+
spec.add_dependency 'dry-validation'
|
37
|
+
spec.add_dependency 'game_validator', '~> 0.6.0'
|
38
38
|
spec.add_development_dependency 'rake', '~> 13.0'
|
39
39
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
40
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spy_alley_application
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Colin Horner
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -31,7 +31,7 @@ dependencies:
|
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 0.1.0
|
34
|
-
type: :
|
34
|
+
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
@@ -45,7 +45,7 @@ dependencies:
|
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
|
-
type: :
|
48
|
+
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
@@ -59,7 +59,7 @@ dependencies:
|
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
|
-
type: :
|
62
|
+
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
@@ -73,7 +73,7 @@ dependencies:
|
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
|
-
type: :
|
76
|
+
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
@@ -87,7 +87,7 @@ dependencies:
|
|
87
87
|
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
|
-
type: :
|
90
|
+
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
@@ -101,7 +101,7 @@ dependencies:
|
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
|
-
type: :
|
104
|
+
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
@@ -115,7 +115,7 @@ dependencies:
|
|
115
115
|
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
|
-
type: :
|
118
|
+
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
@@ -129,7 +129,7 @@ dependencies:
|
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: 0.6.0
|
132
|
-
type: :
|
132
|
+
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|