public CodeLine(int line, string code, eBlock block, CodeLine rootLine = null) { lines.Add(line); this.code = code; this.block = block; this.rootLine = rootLine; }
public void SetBlock(BlockVector v, eBlock b) { if (v.Z < 0 || v.Z >= lenZ || v.Y < 0 || v.Y >= lenY || v.X < 0 || v.X >= lenX) { return; } data[v.X, v.Y, v.Z] = new Blocks(b); }
public void SetBlock(int x, int y, int z, eBlock b) { if (z < 0 || z >= lenZ || y < 0 || y >= lenY || x < 0 || x >= lenX) { return; } data[x, y, z] = new Blocks(b); }
public Blocks(eBlock Type) : this() { this.Type = Type; if (canStand) { Mount = eMount.TOP; } else { Mount = eMount.NORTH; } }
bool CheckMount(eBlock t) { switch (t) { case eBlock.TORCH: return(true); case eBlock.LEVER: return(true); case eBlock.BUTTON: return(true); case eBlock.REPEATER: return(true); // block can charge a repeater default: return(false); } }
bool CheckMount(eBlock t) { switch (t) { case eBlock.TORCH: return true; case eBlock.LEVER: return true; case eBlock.BUTTON: return true; case eBlock.REPEATER: return true; // block can charge a repeater default: return false; } }
public void SetBlock(int x, int y, int z, eBlock b) { if (z < 0 || z >= lenZ || y < 0 || y >= lenY || x < 0 || x >= lenX) return; data[x, y, z] = new Blocks(b); }
public void SetBlock(BlockVector v, eBlock b) { if (v.Z < 0 || v.Z >= lenZ || v.Y < 0 || v.Y >= lenY || v.X < 0 || v.X >= lenX) return; data[v.X,v.Y,v.Z] = new Blocks(b); }
public Blocks(eBlock Type, int Power) : this(Type) { this.Power = Power; }
public Blocks(eBlock Type) : this() { this.Type = Type; if (canStand) Mount = eMount.TOP; else Mount = eMount.NORTH; }
private static void ProcessTimetableVariations(TrainVariations variations) { eTrain train = new eTrain(); train.id = variations.traincode; train.description = variations.category; train.scope = tTrainScope.primary; List <eTrainPart> trainparts = new List <eTrainPart>(); for (int i = 0; i < variations.dates.Count; i++) { try { eTrainPart trainpart = new eTrainPart() { id = train.id + "-" + i.ToString() }; var operatingperiod = CreateOperatingPeriod(variations.dates[i]); trainpart.operatingPeriodRef = new eOperatingPeriodRef() { @ref = operatingperiod.id }; DataContainer.model.timetable.operatingPeriods.Add(operatingperiod); eOcpTT departure = new eOcpTT() { ocpRef = DataContainer.model.infrastructure.operationControlPoints.Single(x => x.code == variations.reps[i].origin).id }; departure.times.Add(new eArrivalDepartureTimes() { departure = variations.reps[i].departuretime, scope = "scheduled" }); trainpart.ocpsTT.Add(departure); foreach (Stop stop in variations.reps[i].stops) { eOcpTT ocp = new eOcpTT() { ocpRef = DataContainer.model.infrastructure.operationControlPoints.Single(x => x.code == stop.location).id }; ocp.times.Add(new eArrivalDepartureTimes() { arrival = stop.arrival, departure = stop.departure, scope = "scheduled" }); trainpart.ocpsTT.Add(ocp); } eOcpTT arrival = new eOcpTT() { ocpRef = DataContainer.model.infrastructure.operationControlPoints.Single(x => x.code == variations.reps[i].destination).id }; arrival.times.Add(new eArrivalDepartureTimes() { arrival = variations.reps[i].arrivaltime, scope = "scheduled" }); trainpart.ocpsTT.Add(arrival); trainparts.Add(trainpart); tBlockPart blockpart = new tBlockPart() { trainPartRef = trainpart.id, startOcpRef = variations.reps[i].origin, endOcpRef = variations.reps[i].destination, operatingPeriodRef = operatingperiod.id, begin = variations.reps[i].departuretime, end = variations.reps[i].arrivaltime }; DataContainer.IDGenerator(blockpart); eRostering roster = DataContainer.model.timetable.rosterings.Single(e => e.name == variations.category); roster.blockParts.blockPart.Add(blockpart); eBlock block = new eBlock() { code = train.id }; DataContainer.IDGenerator(block); eBlockPartSequence seq = new eBlockPartSequence() { sequence = "1" }; seq.blockPartRef.Add(new tBlockPartRef() { @ref = blockpart.id }); block.blockPartSequence.Add(seq); roster.blocks.Add(block); tCirculation circ = new tCirculation() { startDate = operatingperiod.startDate, endDate = operatingperiod.endDate, operatingPeriodRef = operatingperiod.id, blockRef = block.id }; roster.circulations.Add(circ); } catch { unhandled++; } } for (int i = 0; i < trainparts.Count; i++) { eTrainPartSequence seq = new eTrainPartSequence() { sequence = i.ToString() }; seq.trainPartRef.Add(new tTrainPartRef() { @ref = trainparts[i].id }); train.trainPartSequence.Add(seq); } DataContainer.model.timetable.trains.Add(train); DataContainer.model.timetable.trainParts.AddRange(trainparts); }
public Tile(Coord pos) { Position = pos; BlockData = eBlock.None; }