annotate game/IDMPoint.java @ 126:c4d0ceec99ef

Add IDMPoint constructor copying from another IDMPoint.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 24 Nov 2011 21:08:36 +0200
parents 83a79d1698c8
children 4c0dec72e2f0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
73
8c81a3e73a2b Added custom point type for IDM widgets.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 /*
8c81a3e73a2b Added custom point type for IDM widgets.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 * Ristipolku IDM point
8c81a3e73a2b Added custom point type for IDM widgets.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3 * (C) Copyright 2011 Matti 'ccr' Hämäläinen <ccr@tnsp.org>
8c81a3e73a2b Added custom point type for IDM widgets.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 */
8c81a3e73a2b Added custom point type for IDM widgets.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 package game;
8c81a3e73a2b Added custom point type for IDM widgets.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6
8c81a3e73a2b Added custom point type for IDM widgets.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 public class IDMPoint
8c81a3e73a2b Added custom point type for IDM widgets.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 {
8c81a3e73a2b Added custom point type for IDM widgets.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 public float x, y;
8c81a3e73a2b Added custom point type for IDM widgets.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10
8c81a3e73a2b Added custom point type for IDM widgets.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 public IDMPoint(float x, float y)
8c81a3e73a2b Added custom point type for IDM widgets.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 {
8c81a3e73a2b Added custom point type for IDM widgets.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13 this.x = x;
8c81a3e73a2b Added custom point type for IDM widgets.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 this.y = y;
8c81a3e73a2b Added custom point type for IDM widgets.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 }
79
83a79d1698c8 Method for creating a copy of a point.
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
16
126
c4d0ceec99ef Add IDMPoint constructor copying from another IDMPoint.
Matti Hamalainen <ccr@tnsp.org>
parents: 79
diff changeset
17 public IDMPoint(IDMPoint pt)
c4d0ceec99ef Add IDMPoint constructor copying from another IDMPoint.
Matti Hamalainen <ccr@tnsp.org>
parents: 79
diff changeset
18 {
c4d0ceec99ef Add IDMPoint constructor copying from another IDMPoint.
Matti Hamalainen <ccr@tnsp.org>
parents: 79
diff changeset
19 this.x = pt.x;
c4d0ceec99ef Add IDMPoint constructor copying from another IDMPoint.
Matti Hamalainen <ccr@tnsp.org>
parents: 79
diff changeset
20 this.y = pt.y;
c4d0ceec99ef Add IDMPoint constructor copying from another IDMPoint.
Matti Hamalainen <ccr@tnsp.org>
parents: 79
diff changeset
21 }
c4d0ceec99ef Add IDMPoint constructor copying from another IDMPoint.
Matti Hamalainen <ccr@tnsp.org>
parents: 79
diff changeset
22
79
83a79d1698c8 Method for creating a copy of a point.
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
23 public IDMPoint copy()
83a79d1698c8 Method for creating a copy of a point.
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
24 {
83a79d1698c8 Method for creating a copy of a point.
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
25 return new IDMPoint(x, y);
83a79d1698c8 Method for creating a copy of a point.
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
26 }
73
8c81a3e73a2b Added custom point type for IDM widgets.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 }