eidolon 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OGMzNDAyODEyMGZmOTQwYmJmNzc4NDNiZmU4MWU5MDRhY2Q1NGJlMg==
4
+ NzM5OGJhNmNhNmY4YzU5OWQ5OGIyYTIzMDhiMmU5ODMyZjBiMzQ4Yw==
5
5
  data.tar.gz: !binary |-
6
- NTNjMDMxMGYwNjliMGI5MDc4YjE0ZjIwODdkZDk4NzA2ZjUxNmZlMA==
6
+ MjQ5NzgxYzNiZWMyNWM3NDlkOWIyYTBiNGY3Nzk1ZTQ4OGJiNzBjMA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzEwZjc1MTVmNDhjNmYzNWNlZGNhMzk2ZWFmNjQzZjdlN2JlMjgzZGExODhl
10
- MmNlZDRjOGQzNDIyNTQ2N2Y5NGUwNGI3MGNiODYwNzg3MTJmOGRmMmNjMjE0
11
- NjU0NjEzMmRlZWU1MjAxZjcyYzM4NTE4MTExYjRkYTBlNWM0NGY=
9
+ YzQwMTNkNDc3ZDk5ZThiOWIxODlhMDk3MDM2YmIzNDJiOWVkNGI1NjQ4M2Rj
10
+ MzJhNmE5YzljNDlkYjU1YzgxODUyY2NjYmYyM2VjM2ZlZDBmZDBlMmEzY2U5
11
+ YTdlYjA0NGQzNDc4NDhmZTllM2NjMmM4N2IwNTUxZTk0ZWE3MWY=
12
12
  data.tar.gz: !binary |-
13
- NjcxZWE5YWM3OTMyODg5MDc2OThmMTE1YmUxOWI0OWFmNmNiNjgxNjY3MTEz
14
- MDgzZGM1MTMxZTYxN2IxNzdiZTYyYWUzOTk4MjA5ZDEzZmFlNzBkODFhZDdm
15
- Yjg1NTgwMWFhMWRmOTE2NjQzN2JmNmFiYWZlOTM0YmE0ZDk1Mjg=
13
+ MDAzMjhmNmNlNjlkYzk2OGM3ZjE3MTU0YWY1MWFkYWEwM2EwZDdiNjU4NDJl
14
+ ZWRhNjBmYzc0MDMwODVlYjk5NGUzNmExMTk2YzRhMTFhOGFhZjJhZWI4NGMy
15
+ MjRjZDhmNWE3ODRlMWI1ZGI2OWM2N2ViZDc2ZWY4YjBiOTQ3Njk=
@@ -14,10 +14,24 @@ class Table
14
14
  # Size of the Table's Z dimension.
15
15
  attr_reader :zsize
16
16
 
17
+ # Accesses the array's elements. Pulls the same number of arguments as there
18
+ # are dimensions in the created array. Returns +nil+ if the specified element
19
+ # does not exist.
20
+ def [](x, y = 0, z = 0)
21
+ return nil if x >= @xsize || y >= @ysize
22
+ @data[x + y * @xsize + z * @xsize * @ysize]
23
+ end
24
+
25
+ # Provides object inspection identical to that provided by RGSSx.
26
+ def to_s
27
+ "#<Table:0x#{(object_id << 1).to_s(16)}>"
28
+ end
29
+ alias :inspect :to_s
30
+
17
31
  private
18
32
  def self._load(array)
19
33
  self.new.instance_eval do
20
- @size, @xsize, @ysize, @zsize, _, *@data = array.unpack('LLLLLS*')
34
+ _, @xsize, @ysize, @zsize, _, *@data = array.unpack('LLLLLS*')
21
35
  self
22
36
  end
23
37
  end
@@ -6,5 +6,5 @@ module Eidolon
6
6
  }
7
7
 
8
8
  # Semantic version of the Eidolon RGSSx builder.
9
- VERSION = '0.2.0'
10
- end
9
+ VERSION = '0.2.1'
10
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eidolon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solistra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-26 00:00:00.000000000 Z
11
+ date: 2014-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yard