arkaan 1.2.9 → 1.2.10
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 +4 -4
- data/lib/arkaan/campaign.rb +2 -2
- data/lib/arkaan/campaigns.rb +1 -1
- data/lib/arkaan/campaigns/messages.rb +9 -0
- data/lib/arkaan/campaigns/messages/base.rb +20 -0
- data/lib/arkaan/campaigns/messages/diceroll.rb +21 -0
- data/lib/arkaan/campaigns/messages/text.rb +15 -0
- metadata +5 -2
- data/lib/arkaan/campaigns/message.rb +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b50f576a1b8c4a3c6a23194c4051d2f8bb9f55c8
|
4
|
+
data.tar.gz: 29d138e61520cd6bb7f2e92118d3a07685feaf70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1df51808e2ec4c7653c3e225e7ba5d3c585d07b59697d9cb84bd075ab823cac01179d474667d44d78c5f03b2b841a4aea01dbc05b4fdbf042d822e73105eeda5
|
7
|
+
data.tar.gz: dda67b64617e4a7e3ddc94be58884090338ee1fef4f3b388fb9e1684120b2f21129333428037bbaa5a2547bf678ca8aa2a0f1fb4d9e1c6d21f122fe9dc7a857f
|
data/lib/arkaan/campaign.rb
CHANGED
@@ -26,8 +26,8 @@ module Arkaan
|
|
26
26
|
has_many :invitations, class_name: 'Arkaan::Campaigns::Invitation', inverse_of: :campaign
|
27
27
|
|
28
28
|
# @!attribute [rw] messages
|
29
|
-
# @return [Array<Arkaan::Campaigns::
|
30
|
-
embeds_many :messages, class_name: 'Arkaan::Campaigns::
|
29
|
+
# @return [Array<Arkaan::Campaigns::Messages::Base>] the messages sent in the chatroom of the campaign.
|
30
|
+
embeds_many :messages, class_name: 'Arkaan::Campaigns::Messages::Base', inverse_of: :campaign
|
31
31
|
|
32
32
|
validates :title,
|
33
33
|
presence: {message: 'required'},
|
data/lib/arkaan/campaigns.rb
CHANGED
@@ -3,7 +3,7 @@ module Arkaan
|
|
3
3
|
# @author Vincent Courtois <courtois.vincent@outlook.com>
|
4
4
|
module Campaigns
|
5
5
|
autoload :Invitation, 'arkaan/campaigns/invitation'
|
6
|
-
autoload :
|
6
|
+
autoload :Messages , 'arkaan/campaigns/messages'
|
7
7
|
autoload :Tag , 'arkaan/campaigns/tag'
|
8
8
|
end
|
9
9
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Arkaan
|
2
|
+
module Campaigns
|
3
|
+
# This model represents an in-game tchat message sent in the tchat of a campaign.
|
4
|
+
# @author Vincent Courtois <courtois.vincent@outlook.com>
|
5
|
+
module Messages
|
6
|
+
|
7
|
+
class Base
|
8
|
+
include Mongoid::Document
|
9
|
+
include Mongoid::Timestamps
|
10
|
+
|
11
|
+
# @!attribute [rw] campaign
|
12
|
+
# @return [Arkaan::Campaign] the campaign in which the message has been emitted.
|
13
|
+
embedded_in :campaign, class_name: 'Arkaan::Campaign', inverse_of: :messages
|
14
|
+
# @!attribute [rw] player
|
15
|
+
# @return [Arkaan::Account] the account that has emitted the message in the campaign.
|
16
|
+
belongs_to :player, class_name: 'Arkaan::Campaigns::Invitation'
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Arkaan
|
2
|
+
module Campaigns
|
3
|
+
# This model represents an in-game tchat message sent in the tchat of a campaign.
|
4
|
+
# @author Vincent Courtois <courtois.vincent@outlook.com>
|
5
|
+
module Messages
|
6
|
+
|
7
|
+
class Diceroll < Arkaan::Campaigns::Messages::Base
|
8
|
+
|
9
|
+
# @!attribute [rw] number_of_dices
|
10
|
+
# @return [Integer] the number of dices you want to roll.
|
11
|
+
field :number_of_dices, type: Integer, default: 1
|
12
|
+
# @!attribute [rw] number_of_faces
|
13
|
+
# @return [Integer] the number of faces each dice is supposed to have.
|
14
|
+
field :number_of_faces, type: Integer, default: 20
|
15
|
+
# @!attribute [rw] modifier
|
16
|
+
# @return [Integer] the value added to the sum of all dices to get the final result.
|
17
|
+
field :modifier, type: Integer, default: 0
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Arkaan
|
2
|
+
module Campaigns
|
3
|
+
# This model represents an in-game tchat message sent in the tchat of a campaign.
|
4
|
+
# @author Vincent Courtois <courtois.vincent@outlook.com>
|
5
|
+
module Messages
|
6
|
+
|
7
|
+
class Text < Arkaan::Campaigns::Messages::Base
|
8
|
+
|
9
|
+
# @!attribute [rw] content
|
10
|
+
# @return [String] the content of the message as raw text.
|
11
|
+
field :content, type: String
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arkaan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vincent Courtois
|
@@ -261,7 +261,10 @@ files:
|
|
261
261
|
- lib/arkaan/campaign.rb
|
262
262
|
- lib/arkaan/campaigns.rb
|
263
263
|
- lib/arkaan/campaigns/invitation.rb
|
264
|
-
- lib/arkaan/campaigns/
|
264
|
+
- lib/arkaan/campaigns/messages.rb
|
265
|
+
- lib/arkaan/campaigns/messages/base.rb
|
266
|
+
- lib/arkaan/campaigns/messages/diceroll.rb
|
267
|
+
- lib/arkaan/campaigns/messages/text.rb
|
265
268
|
- lib/arkaan/campaigns/tag.rb
|
266
269
|
- lib/arkaan/concerns.rb
|
267
270
|
- lib/arkaan/concerns/activable.rb
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module Arkaan
|
2
|
-
module Campaigns
|
3
|
-
# This model represents an in-game tchat message sent in the tchat of a campaign.
|
4
|
-
# @author Vincent Courtois <courtois.vincent@outlook.com>
|
5
|
-
class Message
|
6
|
-
include Mongoid::Document
|
7
|
-
include Mongoid::Timestamps
|
8
|
-
|
9
|
-
# @!attribute [rw] content
|
10
|
-
# @return [String] the content of the message as raw text.
|
11
|
-
field :content, type: String
|
12
|
-
|
13
|
-
# @!attribute [rw] campaign
|
14
|
-
# @return [Arkaan::Campaign] the campaign in which the message has been emitted.
|
15
|
-
embedded_in :campaign, class_name: 'Arkaan::Campaign', inverse_of: :messages
|
16
|
-
# @!attribute [rw] player
|
17
|
-
# @return [Arkaan::Account] the account that has emitted the message in the campaign.
|
18
|
-
belongs_to :player, class_name: 'Arkaan::Campaigns::Invitation'
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|