urbanterror 0.2 → 0.3

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.
Files changed (2) hide show
  1. data/lib/urbanterror.rb +22 -10
  2. metadata +3 -3
data/lib/urbanterror.rb CHANGED
@@ -75,17 +75,29 @@ class UrbanTerror
75
75
  return initial - selected_i
76
76
  end
77
77
 
78
- def self.matchType(number)
78
+ def self.matchType(number, abbreviate=false)
79
79
  # 0=FreeForAll, 3=TeamDeathMatch, 4=Team Survivor, 5=Follow the Leader, 6=Capture and Hold, 7=Capture The Flag, 8=Bombmode
80
- match = {
81
- 0 => 'Free For All',
82
- 3 => 'Team Death Match',
83
- 4 => 'Team Survivor',
84
- 5 => 'Follow the Leader',
85
- 6 => 'Capture and Hold',
86
- 7 => 'Capture the Flag',
87
- 8 => 'Bomb Mode'
88
- }
80
+ if abbreviate
81
+ match = {
82
+ 0 => 'FFA',
83
+ 3 => 'TDM',
84
+ 4 => 'TS',
85
+ 5 => 'FTL',
86
+ 6 => 'CAH',
87
+ 7 => 'CTF',
88
+ 8 => 'BOMB'
89
+ }
90
+ else
91
+ match = {
92
+ 0 => 'Free For All',
93
+ 3 => 'Team Death Match',
94
+ 4 => 'Team Survivor',
95
+ 5 => 'Follow the Leader',
96
+ 6 => 'Capture and Hold',
97
+ 7 => 'Capture the Flag',
98
+ 8 => 'Bomb Mode'
99
+ }
100
+ end
89
101
 
90
102
  throw "#{number} is not a valid gametype." if not match.has_key? number
91
103
  match[number]
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: urbanterror
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 2
9
- version: "0.2"
8
+ - 3
9
+ version: "0.3"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ricky Elrod