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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5a09a0dfc560c3f5b49e807ab854f2c95b4f9e63
4
- data.tar.gz: d1723799c1bcda0b258eaf00ec21dfe381877518
3
+ metadata.gz: b50f576a1b8c4a3c6a23194c4051d2f8bb9f55c8
4
+ data.tar.gz: 29d138e61520cd6bb7f2e92118d3a07685feaf70
5
5
  SHA512:
6
- metadata.gz: f45d07c940dd9c01e00e895d8c0d52035a2c114e672d08d65af8165807acba0fb38a193d9797786e87c52f49b2879562ba0494f7a60db940b206503d46c95a56
7
- data.tar.gz: 19f3a9768f07bfa2ee36c277646410cc27c1960eafaf3868eaade312d32f5a2f9ed9e5515a26c327c20dea08e8d6d8bfa42bbddcbce5f195bb1305af849551cd
6
+ metadata.gz: 1df51808e2ec4c7653c3e225e7ba5d3c585d07b59697d9cb84bd075ab823cac01179d474667d44d78c5f03b2b841a4aea01dbc05b4fdbf042d822e73105eeda5
7
+ data.tar.gz: dda67b64617e4a7e3ddc94be58884090338ee1fef4f3b388fb9e1684120b2f21129333428037bbaa5a2547bf678ca8aa2a0f1fb4d9e1c6d21f122fe9dc7a857f
@@ -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::Message>] the messages sent in the chatroom of the campaign.
30
- embeds_many :messages, class_name: 'Arkaan::Campaigns::Message', inverse_of: :campaign
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'},
@@ -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 :Message , 'arkaan/campaigns/message'
6
+ autoload :Messages , 'arkaan/campaigns/messages'
7
7
  autoload :Tag , 'arkaan/campaigns/tag'
8
8
  end
9
9
  end
@@ -0,0 +1,9 @@
1
+ module Arkaan
2
+ module Campaigns
3
+ module Messages
4
+ autoload :Base , 'arkaan/campaigns/messages/base'
5
+ autoload :Diceroll, 'arkaan/campaigns/messages/diceroll'
6
+ autoload :Text , 'arkaan/campaigns/messages/text'
7
+ end
8
+ end
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.9
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/message.rb
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