Revision 1861,
635 bytes
checked in by hniemi, 12 years ago
(diff) |
No minäpä kerron tarinan.
Olipa kerran pieni nörtti, joka taisteli lohikäärmeitä vastaan. Sen pituinen se, hieman tulinen. Matti.
|
Line | |
---|
1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using System.Linq; |
---|
4 | using System.Text; |
---|
5 | |
---|
6 | namespace Pallospeli |
---|
7 | { |
---|
8 | public class Location |
---|
9 | { |
---|
10 | public int X { get; set; } |
---|
11 | public int Y { get; set; } |
---|
12 | |
---|
13 | public Location(int x, int y) |
---|
14 | { |
---|
15 | X = x; |
---|
16 | Y = y; |
---|
17 | } |
---|
18 | |
---|
19 | public static Location operator + (Location a, Location b) |
---|
20 | { |
---|
21 | return new Location(a.X + b.X, a.Y + b.Y); |
---|
22 | } |
---|
23 | |
---|
24 | public static Location operator - (Location a, Location b) |
---|
25 | { |
---|
26 | return new Location(a.X - b.X, a.Y - b.Y); |
---|
27 | } |
---|
28 | } |
---|
29 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.