Permalink
Browse files

Add comments to graph structure fields.

  • Loading branch information...
amitp committed Sep 6, 2010
1 parent 55a7ef8 commit 7014f72ea37b9dcbf6f0d96a62d306d6b299b1a7
Showing with 25 additions and 23 deletions.
  1. +9 −8 graph/Center.as
  2. +12 −11 graph/Corner.as
  3. +4 −4 graph/Edge.as
View
@@ -4,16 +4,17 @@ package graph {
public class Center {
public var index:int;
- public var point:Point;
+ public var point:Point; // location
public var water:Boolean; // lake or ocean
- public var ocean:Boolean;
- public var coast:Boolean;
- public var border:Boolean;
- public var biome:String;
- public var elevation:Number;
- public var moisture:Number;
- public var borders:Vector.<Edge>;
+ public var ocean:Boolean; // ocean
+ public var coast:Boolean; // land polygon touching an ocean
+ public var border:Boolean; // at the edge of the map
+ public var biome:String; // biome type (see article)
+ public var elevation:Number; // 0.0-1.0
+ public var moisture:Number; // 0.0-1.0
+
public var neighbors:Vector.<Center>;
+ public var borders:Vector.<Edge>;
public var corners:Vector.<Corner>;
};
}
View
@@ -4,20 +4,21 @@ package graph {
public class Corner {
public var index:int;
- public var point:Point;
- public var ocean:Boolean;
- public var water:Boolean;
- public var coast:Boolean;
- public var border:Boolean;
- public var elevation:Number;
- public var moisture:Number;
+ public var point:Point; // location
+ public var ocean:Boolean; // ocean
+ public var water:Boolean; // lake or ocean
+ public var coast:Boolean; // touches ocean and land polygons
+ public var border:Boolean; // at the edge of the map
+ public var elevation:Number; // 0.0-1.0
+ public var moisture:Number; // 0.0-1.0
+
+ public var touches:Vector.<Center>;
public var protrudes:Vector.<Edge>;
public var adjacent:Vector.<Corner>;
- public var touches:Vector.<Center>;
- public var river:int;
- public var downslope:Corner;
- public var watershed:Corner;
+ public var river:int; // 0 if no river, or volume of water in river
+ public var downslope:Corner; // pointer to adjacent corner most downhill
+ public var watershed:Corner; // pointer to coastal corner, or null
public var watershed_size:int;
};
}
View
@@ -3,9 +3,9 @@ package graph {
public class Edge {
public var index:int;
- public var v0:Corner, v1:Corner;
- public var d0:Center, d1:Center;
- public var midpoint:Point;
- public var river:int;
+ public var d0:Center, d1:Center; // Delaunay edge
+ public var v0:Corner, v1:Corner; // Voronoi edge
+ public var midpoint:Point; // halfway between v0,v1
+ public var river:int; // volume of water, or 0
};
}

0 comments on commit 7014f72

Please sign in to comment.