Permalink
Browse files

Rename voronoi_set.as to Map.as to better reflect its role as the cor…

…e map class.
  • Loading branch information...
1 parent 7ff42c7 commit 89e96d401b5d036c688f5dbb9583fe72302e0d4c @amitp amitp committed Sep 4, 2010
Showing with 8 additions and 8 deletions.
  1. +1 −1 Lava.as
  2. +2 −2 voronoi_set.as → Map.as
  3. +1 −1 NoisyEdges.as
  4. +1 −1 Roads.as
  5. +3 −3 mapgen2.as
View
@@ -12,7 +12,7 @@ package {
public var lava:Array = []; // edge index -> Boolean
// Lava fissures are at high elevations where moisture is low
- public function createLava(map:voronoi_set, randomDouble:Function):void {
+ public function createLava(map:Map, randomDouble:Function):void {
var edge:Edge;
for each (edge in map.edges) {
if (!edge.river && !edge.d0.water && !edge.d1.water
@@ -12,7 +12,7 @@ package {
import com.nodename.Delaunay.Voronoi;
import de.polygonal.math.PM_PRNG;
- public class voronoi_set {
+ public class Map {
static public var NUM_POINTS:int = 2000;
static public var LAKE_THRESHOLD:Number = 0.3; // 0 to 1, fraction of water corners for water polygon
static public var NUM_LLOYD_ITERATIONS:int = 2;
@@ -38,7 +38,7 @@ package {
public var corners:Vector.<Corner>;
public var edges:Vector.<Edge>;
- public function voronoi_set(size:Number) {
+ public function Map(size:Number) {
SIZE = size;
reset();
}
View
@@ -21,7 +21,7 @@ package {
// distance: path0 is from v0 to the midpoint and path1 is from v1
// to the midpoint. When drawing the polygons, one or the other
// must be drawn in reverse order.
- public function buildNoisyEdges(map:voronoi_set, lava:Lava, random:PM_PRNG):void {
+ public function buildNoisyEdges(map:Map, lava:Lava, random:PM_PRNG):void {
var p:Center, edge:Edge;
for each (p in map.centers) {
for each (edge in p.edges) {
View
@@ -20,7 +20,7 @@ package {
// We want to mark different elevation zones so that we can draw
// island-circling roads that divide the areas.
- public function createRoads(map:voronoi_set):void {
+ public function createRoads(map:Map):void {
// Oceans and coastal polygons are the lowest contour zone
// (1). Anything connected to contour level K, if it's below
// elevation threshold K, or if it's water, gets contour level
View
@@ -1,4 +1,4 @@
-// Display the voronoi graph produced in voronoi_set.as
+// Display the voronoi graph produced in Map.as
// Author: amitp@cs.stanford.edu
// License: MIT
@@ -87,7 +87,7 @@ package {
private var graphicsData:Vector.<IGraphicsData>;
// The map data
- public var map:voronoi_set;
+ public var map:Map;
public var roads:Roads;
public var lava:Lava;
public var noisyEdges:NoisyEdges;
@@ -111,7 +111,7 @@ package {
addGenerateButtons();
addMiscLabels();
- map = new voronoi_set(SIZE);
+ map = new Map(SIZE);
go(islandType);
render3dTimer.addEventListener(TimerEvent.TIMER, function (e:TimerEvent):void {

0 comments on commit 89e96d4

Please sign in to comment.