Example #1
0
        /* Create a zone of the specified type and number of nodes. */
        public Zone(String ID, zoneType ty, int zoneLevel, int numberOfnodes) : base(ID)
        {
            if (zoneLevel < 1 || numberOfnodes < 2)
            {
                throw new ArgumentException(LevelTooLow);
            }
            type  = ty;
            level = zoneLevel;

            if (ty == zoneType.STARTzone) //eerste node van startzone is startnode
            {
                level = 1;
                Node startnode = new Node(NodeType.STARTnode, "Z1N1");
                nodeCounter++;
                startnode.capacity = 0;
                startnode.zone     = this;
                nodes.Add(startnode);
                Dungeon.startnode = startnode;
                for (int i = 2; i < numberOfnodes; i++)
                {
                    addCommonNode();
                }
                nodeCounter = 1;
                makeBridge();
            }

            if (ty == zoneType.InBETWEENzone)
            {
                for (int i = 1; i < numberOfnodes; i++)
                {
                    addCommonNode();
                }
                nodeCounter = 1;
                makeBridge();
            }

            if (ty == zoneType.EXITzone)
            {
                for (int i = 1; i < numberOfnodes; i++)
                {
                    addCommonNode();
                }
                Node exitnode = new Node(NodeType.EXITnode, "" + this.ID + "N" + nodeCounter);
                nodeCounter       = 1;
                exitnode.capacity = 0;
                exitnode.zone     = this;
                connectRandom(exitnode);
                nodes.Add(exitnode);
                Dungeon.exitnode = exitnode;
            }

            // When compiled in the Debug-build, check the following conditions:
            Debug.Assert(nodes.Count >= 2);
            Debug.Assert(ty == zoneType.STARTzone ? HelperPredicates.hasOneStartZone(this) : true);
            Debug.Assert(ty == zoneType.EXITzone ? HelperPredicates.hasOneExitZone(this) : true);
            Debug.Assert(HelperPredicates.isConnected(this));
        }
Example #2
0
 private void buttonPosition_Click(object sender, EventArgs e)
 {
     zone = zoneType.Position;
     labelGoalInfo.Text += "\nЗона - \"Позиция\"";
     panelZones.Visible  = true;
 }
Example #3
0
 private void buttonBreakAway_Click(object sender, EventArgs e)
 {
     zone = zoneType.Breakaway;
     labelGoalInfo.Text += "\nЗона - \"Отрыв\"";
     panelZones.Visible  = true;
 }
 public ITable zonalStats(object inZoneRaster, object inValueRaster, string outTableName, zoneType[] zoneTypes, esriUtil.Forms.RunningProcess.frmRunningProcessDialog rd,bool classCounts=false)
 {
     FunctionRasters.zonalHelper zH = new FunctionRasters.zonalHelper(this,rd);
     zH.InValueRaster = createIdentityRaster(inValueRaster);
     zH.InZoneRaster =createIdentityRaster(inZoneRaster);
     zH.ZoneTypes = zoneTypes;
     zH.OutTableName = outTableName;
     zH.ZoneClassCount = classCounts;
     zH.setZoneValues();
     return zH.OutTable;
 }