locationclass 0.0.0
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 +7 -0
- data/lib/main.rb +21 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 467c5e23ecb8ef8f362dfe9da94f7bf3d2267aea
|
4
|
+
data.tar.gz: a46057e8acc8e4a801f60ad47981f205fd8e389e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5dc81174aa58d68946557825fd901993eb83d29e0fe122b02f5239f9dee093e50d701edcaf370df1368ebb7caff864be1710aeaaf8c3c6cac59f04af1b195daa
|
7
|
+
data.tar.gz: bb105f9f17f397a0fb4e02453d89cfa71396765eb7143c8792d893f44d245f13cd29efa9056184a54e165742157c5ae50505777d31fcaec227315f95a280ef9c
|
data/lib/main.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
class Location
|
2
|
+
attr_accessor ( :x )
|
3
|
+
attr_accessor ( :y )
|
4
|
+
|
5
|
+
#Sets the x and y to the given values.
|
6
|
+
def initialize(x, y)
|
7
|
+
@x = x
|
8
|
+
@y = y
|
9
|
+
end
|
10
|
+
|
11
|
+
#Increases the x and y by the given amounts.
|
12
|
+
def move(x, y)
|
13
|
+
@x += x
|
14
|
+
@y += y
|
15
|
+
end
|
16
|
+
#Decreases the x and y by the given amounts.
|
17
|
+
def moveNeg(x, y)
|
18
|
+
@x -= x
|
19
|
+
@y -= y
|
20
|
+
end
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: locationclass
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- SugarRush
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-10-06 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Represents a point on a 2D grid.
|
14
|
+
email:
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/main.rb
|
20
|
+
homepage: http://rubygems.org/gems/locationclass
|
21
|
+
licenses:
|
22
|
+
- None
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubyforge_project:
|
40
|
+
rubygems_version: 2.6.14.1
|
41
|
+
signing_key:
|
42
|
+
specification_version: 4
|
43
|
+
summary: Represents a location
|
44
|
+
test_files: []
|