Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
PartialMap Class Reference
Inheritance diagram for PartialMap:
EClass

Classes

class  Result
 

Public Types

enum  ApplyMode { Render , HitTest , Apply , Evaluate }
 

Public Member Functions

void Rotate ()
 
void ClearMarkedCells ()
 
void Apply (Point _point, ApplyMode mode)
 
int FixWall (Cell c)
 
void Update ()
 
void Save (int _x, int _z, int _w, int _h)
 
void _Load ()
 

Static Public Member Functions

static PartialMap Apply (string path, Point pos)
 
static PartialMap Load (string path=null)
 
static void Delete (string path)
 
static void ExportDialog (string dir=null)
 
static void SavePreview (string path, string pathDest)
 
- Static Public Member Functions inherited from EClass
static int rnd (int a)
 
static int curve (int a, int start, int step, int rate=75)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 

Public Attributes

string name
 
int offsetX
 
int offsetZ
 
int w
 
int h
 
int dir
 
int baseHeight
 
int baseHeightWater
 
int value
 
bool allowRotate
 
bool ignoreBlock
 
int localOffsetX
 
int localOffsetZ
 
int destX
 
int destZ
 
string path
 
bool editMode
 
bool procedural
 
float ruinChance
 
Map map
 
ZoneExportData exportData
 
List< CellcellsMarked = new List<Cell>()
 
HashSet< int > validPoints = new HashSet<int>()
 
Result result = new Result()
 

Static Public Attributes

static bool relative
 
- Static Public Attributes inherited from EClass
static Core core
 

Properties

static string PathTemp [get]
 
bool altDirPosition [get]
 
string ID [get]
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Detailed Description

Definition at line 8 of file PartialMap.cs.

Member Enumeration Documentation

◆ ApplyMode

Enumerator
Render 
HitTest 
Apply 
Evaluate 

Definition at line 10 of file PartialMap.cs.

Member Function Documentation

◆ _Load()

void PartialMap._Load ( )
inline

Definition at line 474 of file PartialMap.cs.

475 {
476 map = GameIO.LoadFile<Map>(EClass._zone.pathTemp + "map");
477 map.Load(EClass._zone.pathTemp, import: false, this);
478 if (map == null)
479 {
480 Debug.Log("Map is null:" + name + "/" + PathTemp);
481 return;
482 }
484 baseHeight = 255;
485 baseHeightWater = 255;
486 for (int i = 0; i < w; i++)
487 {
488 for (int j = 0; j < h; j++)
489 {
490 Cell cell = map.cells[i, j];
491 if (cell.height < baseHeight)
492 {
493 baseHeightWater = cell.height;
494 }
495 if (cell.height < baseHeight && !cell.IsFloorWater)
496 {
497 baseHeight = cell.height;
498 }
499 }
500 }
501 if (baseHeight == 255)
502 {
503 baseHeight = 0;
504 }
505 }
Definition: Cell.cs:7
bool IsFloorWater
Definition: Cell.cs:727
byte height
Definition: Cell.cs:72
Definition: EClass.cs:5
static Zone _zone
Definition: EClass.cs:20
static Map _map
Definition: EClass.cs:18
Definition: GameIO.cs:10
Definition: Map.cs:13
void SetReference()
Definition: Map.cs:195
Cell[,] cells
Definition: Map.cs:85
void Load(string path, bool import=false, PartialMap partial=null)
Definition: Map.cs:542
int baseHeight
Definition: PartialMap.cs:46
int baseHeightWater
Definition: PartialMap.cs:49
static string PathTemp
Definition: PartialMap.cs:86
string name
Definition: PartialMap.cs:28
string pathTemp
Definition: Zone.cs:158

References EClass._map, EClass._zone, baseHeight, baseHeightWater, Map.cells, Debug, h, Cell.height, Cell.IsFloorWater, Map.Load(), map, name, PathTemp, Zone.pathTemp, Map.SetReference(), and w.

Referenced by Load().

◆ Apply() [1/2]

void PartialMap.Apply ( Point  _point,
ApplyMode  mode 
)
inline

Definition at line 112 of file PartialMap.cs.

113 {
114 byte height = _point.cell.height;
115 int num = (_point.cell.IsFloorWater ? baseHeightWater : baseHeight);
116 Point point = new Point(_point);
117 point.x += localOffsetX;
118 point.z += localOffsetZ;
119 if (altDirPosition)
120 {
121 switch (dir)
122 {
123 case 1:
124 point.z += w - 1;
125 break;
126 case 2:
127 point.x += w - 1;
128 point.z += h - 1;
129 break;
130 case 3:
131 point.x += h - 1;
132 break;
133 }
134 }
135 destX = point.x;
136 destZ = point.z;
137 Point p = new Point();
138 if (mode == ApplyMode.Render)
139 {
141 }
142 if (mode == ApplyMode.Evaluate)
143 {
144 value = 0;
145 }
146 int num2 = 0;
147 int num3 = 0;
148 int minX = point.x;
149 int minZ = point.z;
150 int maxX = point.x + w;
151 int maxZ = point.z + h;
152 switch (dir)
153 {
154 case 1:
155 minX = point.x;
156 maxX = point.x + h;
157 minZ = point.z - w + 1;
158 maxZ = point.z + 1;
159 break;
160 case 2:
161 minX = point.x - w + 1;
162 maxX = point.x + 1;
163 minZ = point.z - h + 1;
164 maxZ = point.z + 1;
165 break;
166 case 3:
167 minX = point.x - h + 1;
168 maxX = point.x + 1;
169 minZ = point.z;
170 maxZ = point.z + w;
171 break;
172 }
176 this.result.ruined.Clear();
177 Cell c1;
179 for (int i = 0; i < w; i++)
180 {
181 for (int j = 0; j < h; j++)
182 {
183 Cell cell = map.cells[i, j];
184 p.Set(point.x + num2, point.z + num3);
185 if (EClass._map.Contains(p))
186 {
187 c1 = EClass._map.cells[p.x, p.z];
188 result = HitResult.Valid;
189 if (c1.isFloating)
190 {
191 result = HitResult.Invalid;
192 }
193 if (result == HitResult.Valid)
194 {
195 validPoints.Add(p.index);
196 }
197 if (mode == ApplyMode.Render)
198 {
199 c1.skipRender = true;
200 cellsMarked.Add(c1);
201 if (result != HitResult.Valid)
202 {
203 MeshPass guidePass = ActionMode.Copy.GetGuidePass(point);
204 int num4 = (int)result;
205 Vector3 vector = p.Position();
206 guidePass.Add(vector.x, vector.y, vector.z - 0.01f, num4, 0.3f);
207 }
208 else
209 {
210 Render(cell.sourceFloor, cell.floorDir, 0);
211 Render(cell.sourceBlock, cell.HasWall ? FixWall(cell) : cell.blockDir, 0);
212 Render(cell.sourceObj, cell.objDir, 0);
213 Render(cell.sourceBridge, cell.floorDir, (cell.bridgeHeight != 0) ? (cell.bridgeHeight - cell.height) : 0);
215 {
216 Recipe orCreate = Recipe.GetOrCreate(EClass.sources.cards.map[card.id].RecipeID);
217 if (card.x - offsetX == i && card.z - offsetZ == j)
218 {
219 if (relative)
220 {
221 orCreate?.OnRenderMarker(p, active: true, result, main: true, card.dir, height + cell.height - num);
222 }
223 else
224 {
225 orCreate?.OnRenderMarker(p, active: true, result, main: true, card.dir, cell.height);
226 }
227 }
228 }
230 }
231 }
232 if (mode == ApplyMode.Apply && result == HitResult.Valid)
233 {
234 if (Rand.Range(0f, 1f) < ruinChance)
235 {
236 this.result.ruined.Add(p.index);
237 }
238 else if (cell._floor != 77 || editMode)
239 {
240 if (cell._block == 149 && !editMode)
241 {
242 c1._block = (byte)interior.block.id;
243 c1._blockMat = (byte)interior.block.mat;
244 }
245 else if (cell._block == 150 && !editMode)
246 {
247 c1._block = (byte)exterior.block.id;
248 c1._blockMat = (byte)exterior.block.mat;
249 }
250 else
251 {
252 c1._block = cell._block;
253 c1._blockMat = cell._blockMat;
254 }
255 if (cell._floor == 2 && !editMode)
256 {
257 c1._floor = (byte)interior.floor.id;
258 c1._floorMat = (byte)interior.floor.mat;
259 }
260 else if (cell._floor == 3 && !editMode)
261 {
262 c1._floor = (byte)exterior.floor.id;
263 c1._floorMat = (byte)exterior.floor.mat;
264 }
265 else
266 {
267 c1._floor = cell._floor;
268 c1._floorMat = cell._floorMat;
269 }
270 c1._roofBlock = cell._roofBlock;
271 c1._roofBlockMat = cell._roofBlockMat;
272 c1.obj = cell.obj;
273 c1.objMat = cell.objMat;
274 c1.objVal = cell.objVal;
275 c1.decal = cell.decal;
276 c1._dirs = cell._dirs;
277 c1._bridge = cell._bridge;
278 c1._bridgeMat = cell._bridgeMat;
279 c1.bridgePillar = cell.bridgePillar;
280 c1.isModified = true;
281 if (c1.HasWall)
282 {
283 c1.blockDir = FixWall(c1);
284 }
285 if (relative || procedural)
286 {
287 c1.height = (byte)Mathf.Clamp(height + cell.height - num, 0, 255);
288 c1.bridgeHeight = (byte)Mathf.Clamp((cell.bridgeHeight != 0) ? (c1.height + (cell.bridgeHeight - cell.height)) : 0, 0, 255);
289 }
290 else
291 {
292 c1.height = cell.height;
293 c1.bridgeHeight = cell.bridgeHeight;
294 }
295 }
296 }
297 }
298 switch (dir)
299 {
300 case 0:
301 num3++;
302 if (num3 >= h)
303 {
304 num3 = 0;
305 num2++;
306 }
307 break;
308 case 1:
309 num2++;
310 if (num2 >= h)
311 {
312 num2 = 0;
313 num3--;
314 }
315 break;
316 case 2:
317 num3--;
318 if (num3 <= -h)
319 {
320 num3 = 0;
321 num2--;
322 }
323 break;
324 case 3:
325 num2--;
326 if (num2 <= -h)
327 {
328 num2 = 0;
329 num3++;
330 }
331 break;
332 }
333 }
334 }
335 if (mode != ApplyMode.Apply)
336 {
337 return;
338 }
339 p.Set(point.x, point.z);
341 EClass._map.things.ForeachReverse(delegate(Thing t)
342 {
343 if (validPoints.Contains(t.pos.index) && t.pos.x >= minX && t.pos.z >= minZ && t.pos.x < maxX && t.pos.z < maxZ && t.trait.CanBeDestroyed)
344 {
345 t.Destroy();
346 }
347 });
348 if (exportData != null)
349 {
350 exportData.serializedCards.Restore(EClass._map, null, addToZone: true, this);
351 }
354 void Render(TileRow row, int dir, int bridgeHeight)
355 {
356 if (row.id != 0)
357 {
358 Recipe orCreate2 = Recipe.GetOrCreate(row.RecipeID);
359 if (relative)
360 {
361 orCreate2?.OnRenderMarker(p, active: true, result, main: true, dir, c1.height + bridgeHeight);
362 }
363 else
364 {
365 orCreate2?.OnRenderMarker(p, active: true, result, main: true, dir, c1.height + bridgeHeight);
366 }
367 }
368 }
369 }
HitResult
Definition: HitResult.cs:2
virtual MeshPass GetGuidePass(Point point)
Definition: ActionMode.cs:1263
static AM_Copy Copy
Definition: ActionMode.cs:45
TileGroup exterior
TileGroup interior
int GetCurrency(string id="money")
Definition: Card.cs:3652
Point pos
Definition: Card.cs:55
Trait trait
Definition: Card.cs:49
void Destroy()
Definition: Card.cs:4538
byte _block
Definition: Cell.cs:30
SourceBlock.Row sourceBlock
Definition: Cell.cs:1052
byte objMat
Definition: Cell.cs:42
SourceFloor.Row sourceFloor
Definition: Cell.cs:1054
byte _bridge
Definition: Cell.cs:46
byte _floor
Definition: Cell.cs:34
byte decal
Definition: Cell.cs:44
bool isFloating
Definition: Cell.cs:474
byte objVal
Definition: Cell.cs:40
byte _floorMat
Definition: Cell.cs:36
bool HasWall
Definition: Cell.cs:833
byte _blockMat
Definition: Cell.cs:32
byte _roofBlock
Definition: Cell.cs:50
byte _bridgeMat
Definition: Cell.cs:48
SourceFloor.Row sourceBridge
Definition: Cell.cs:1056
int floorDir
Definition: Cell.cs:922
byte _roofBlockMat
Definition: Cell.cs:52
byte obj
Definition: Cell.cs:38
SourceObj.Row sourceObj
Definition: Cell.cs:1072
int objDir
Definition: Cell.cs:910
byte bridgeHeight
Definition: Cell.cs:74
int blockDir
Definition: Cell.cs:898
byte _dirs
Definition: Cell.cs:28
byte bridgePillar
Definition: Cell.cs:82
static void RebuildCritter(Cell cell)
Definition: Critter.cs:93
static SourceManager sources
Definition: EClass.cs:42
static Chara pc
Definition: EClass.cs:14
bool Contains(int dx, int dz)
Definition: MapBounds.cs:38
List< Thing > things
Definition: Map.cs:49
void RefreshAllTiles()
Definition: Map.cs:2086
void Add(Point point, float tile=0f, float color=0f)
Definition: MeshPass.cs:122
List< int > ruined
Definition: PartialMap.cs:22
int localOffsetZ
Definition: PartialMap.cs:62
int offsetX
Definition: PartialMap.cs:31
ZoneExportData exportData
Definition: PartialMap.cs:78
int offsetZ
Definition: PartialMap.cs:34
int FixWall(Cell c)
Definition: PartialMap.cs:371
void ClearMarkedCells()
Definition: PartialMap.cs:103
int localOffsetX
Definition: PartialMap.cs:60
float ruinChance
Definition: PartialMap.cs:74
HashSet< int > validPoints
Definition: PartialMap.cs:82
Result result
Definition: PartialMap.cs:84
List< Cell > cellsMarked
Definition: PartialMap.cs:80
bool altDirPosition
Definition: PartialMap.cs:88
static bool relative
Definition: PartialMap.cs:25
bool editMode
Definition: PartialMap.cs:70
bool procedural
Definition: PartialMap.cs:72
Definition: Point.cs:9
int index
Definition: Point.cs:49
ref Vector3 Position(int height)
Definition: Point.cs:524
Point Set(int _x, int _z)
Definition: Point.cs:479
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
Cell cell
Definition: Point.cs:51
Definition: Rand.cs:4
static int Range(int min, int max)
Definition: Rand.cs:42
Definition: Recipe.cs:7
virtual void OnRenderMarker(Point point, bool active, HitResult result, bool main, int dir, int bridgeHeight)
Definition: Recipe.cs:688
static Recipe GetOrCreate(string id)
Definition: Recipe.cs:293
virtual string RecipeID
Definition: RenderRow.cs:105
List< Data > cards
void Restore(Map map, Map orgMap, bool addToZone, PartialMap partial=null)
Dictionary< string, CardRow > map
Definition: SourceCard.cs:8
SourceCard cards
Definition: Thing.cs:8
int id
Definition: TileRow.cs:8
virtual bool CanBeDestroyed
Definition: Trait.cs:285
SerializedCards serializedCards
BiomeProfile biome
Definition: Zone.cs:126

References Cell._block, Cell._blockMat, Cell._bridge, Cell._bridgeMat, Cell._dirs, Cell._floor, Cell._floorMat, EClass._map, Cell._roofBlock, Cell._roofBlockMat, EClass._zone, MeshPass.Add(), altDirPosition, baseHeight, baseHeightWater, Zone.biome, BiomeProfile.TileGroup.block, Cell.blockDir, Cell.bridgeHeight, Cell.bridgePillar, Trait.CanBeDestroyed, card, SerializedCards.cards, SourceManager.cards, Point.cell, Map.cells, cellsMarked, ClearMarkedCells(), MapBounds.Contains(), ActionMode.Copy, Cell.decal, Card.Destroy(), destX, destZ, dir, editMode, exportData, BiomeProfile.exterior, FixWall(), BiomeProfile.TileGroup.floor, Cell.floorDir, Card.GetCurrency(), ActionMode.GetGuidePass(), Recipe.GetOrCreate(), h, Cell.HasWall, Cell.height, BiomeProfile.Tile.id, TileRow.id, Point.index, BiomeProfile.interior, Cell.isFloating, localOffsetX, localOffsetZ, map, SourceCard.map, BiomeProfile.Tile.mat, Cell.obj, Cell.objDir, Cell.objMat, Cell.objVal, offsetX, offsetZ, Recipe.OnRenderMarker(), EClass.pc, Card.pos, Point.Position(), procedural, Rand.Range(), Critter.RebuildCritter(), RenderRow.RecipeID, Map.RefreshAllTiles(), relative, Render, SerializedCards.Restore(), result, ruinChance, PartialMap.Result.ruined, ZoneExportData.serializedCards, Point.Set(), Map.SetReference(), Cell.sourceBlock, Cell.sourceBridge, Cell.sourceFloor, Cell.sourceObj, EClass.sources, Map.things, Card.trait, validPoints, value, w, Point.x, and Point.z.

Referenced by Apply(), AM_Copy.OnAfterProcessTiles(), AM_Copy.OnRenderTile(), ZoneEventHarvest.OnVisit(), and GenBounds.TryAddMapPiece().

◆ Apply() [2/2]

static PartialMap PartialMap.Apply ( string  path,
Point  pos 
)
inlinestatic

Definition at line 440 of file PartialMap.cs.

441 {
442 PartialMap partialMap = Load(CorePath.MapPieceSave + path);
443 partialMap.ruinChance = 0f;
444 partialMap.Apply(pos, ApplyMode.Apply);
445 return partialMap;
446 }
static string MapPieceSave
Definition: CorePath.cs:200
string path
Definition: PartialMap.cs:68
void Apply(Point _point, ApplyMode mode)
Definition: PartialMap.cs:112
static PartialMap Load(string path=null)
Definition: PartialMap.cs:448

References Apply(), Load(), CorePath.MapPieceSave, and path.

◆ ClearMarkedCells()

void PartialMap.ClearMarkedCells ( )
inline

Definition at line 103 of file PartialMap.cs.

104 {
105 foreach (Cell item in cellsMarked)
106 {
107 item.skipRender = false;
108 }
109 cellsMarked.Clear();
110 }

References cellsMarked, and item.

Referenced by Apply(), AM_Copy.Clear(), and AM_Copy.OnDeactivate().

◆ Delete()

static void PartialMap.Delete ( string  path)
inlinestatic

Definition at line 507 of file PartialMap.cs.

508 {
509 string fullFileNameWithoutExtension = path.GetFullFileNameWithoutExtension();
511 IO.DeleteFile(fullFileNameWithoutExtension + ".jpg");
512 IO.DeleteFile(fullFileNameWithoutExtension + ".txt");
513 }
Definition: IO.cs:11
static void DeleteFile(string path)
Definition: IO.cs:313

References path.

Referenced by UIScreenshot.Activate(), and AM_Copy.RefreshMenu().

◆ ExportDialog()

static void PartialMap.ExportDialog ( string  dir = null)
inlinestatic

Definition at line 515 of file PartialMap.cs.

516 {
518 {
519 string pathDest = StandaloneFileBrowser.SaveFilePanel("Export Map Piece", dir ?? CorePath.MapPieceSaveUser, "new map piece", "mp");
520 if (!string.IsNullOrEmpty(pathDest))
521 {
522 SavePreview(PathTemp, pathDest);
523 Msg.SayRaw("Exported Zone");
524 }
525 });
526 }
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
void WaitForEndOfFrame(Action action)
Definition: BaseCore.cs:61
static string MapPieceSaveUser
Definition: CorePath.cs:202
static Core core
Definition: EClass.cs:6
Definition: Msg.cs:5
static string SayRaw(string text)
Definition: Msg.cs:113
static void SavePreview(string path, string pathDest)
Definition: PartialMap.cs:528
static string SaveFilePanel(string title, string directory, string defaultName, string extension)

References EClass.core, dir, if(), CorePath.MapPieceSaveUser, PathTemp, SFB.StandaloneFileBrowser.SaveFilePanel(), SavePreview(), Msg.SayRaw(), and BaseCore.WaitForEndOfFrame().

Referenced by AM_Copy.OnUpdateInput().

◆ FixWall()

int PartialMap.FixWall ( Cell  c)
inline

Definition at line 371 of file PartialMap.cs.

372 {
373 switch (dir)
374 {
375 case 1:
376 if (c.blockDir == 0)
377 {
378 return 1;
379 }
380 if (c.blockDir == 1)
381 {
382 return 0;
383 }
384 break;
385 case 3:
386 if (c.blockDir == 0)
387 {
388 return 1;
389 }
390 if (c.blockDir == 1)
391 {
392 return 0;
393 }
394 if (c.blockDir == 2)
395 {
396 return 0;
397 }
398 break;
399 }
400 return c.blockDir;
401 }

References Cell.blockDir, and dir.

Referenced by Apply().

◆ Load()

static PartialMap PartialMap.Load ( string  path = null)
inlinestatic

Definition at line 448 of file PartialMap.cs.

449 {
450 bool flag = path.IsEmpty();
451 if (flag)
452 {
453 path = PathTemp;
454 }
455 if (!File.Exists(path))
456 {
457 return null;
458 }
459 MapMetaData metaData = Map.GetMetaData(path);
460 if (metaData == null || metaData.partial == null)
461 {
462 return null;
463 }
464 PartialMap partial = metaData.partial;
465 if (!flag)
466 {
467 partial.path = path;
468 }
469 partial.exportData = EClass._zone.Import(path);
470 partial._Load();
471 return partial;
472 }
PartialMap partial
Definition: MapMetaData.cs:19
static MapMetaData GetMetaData(string pathZip)
Definition: Map.cs:732
void _Load()
Definition: PartialMap.cs:474
ZoneExportData Import(string path)
Definition: Zone.cs:2889

References _Load(), EClass._zone, Map.GetMetaData(), Zone.Import(), MapMetaData.partial, path, and PathTemp.

Referenced by Apply(), MapPiece.GetMap(), AM_Copy.Import(), and AM_Copy.OnAfterProcessTiles().

◆ Rotate()

void PartialMap.Rotate ( )
inline

Definition at line 92 of file PartialMap.cs.

93 {
94 dir++;
95 if (dir > 3)
96 {
97 dir = 0;
98 }
99 SE.Rotate();
101 }

References dir, localOffsetX, and localOffsetZ.

Referenced by AM_Copy.RotateUnderMouse().

◆ Save()

void PartialMap.Save ( int  _x,
int  _z,
int  _w,
int  _h 
)
inline

Definition at line 411 of file PartialMap.cs.

412 {
413 offsetX = _x;
414 offsetZ = _z;
415 w = _w;
416 h = _h;
417 value = 0;
418 for (int i = _x; i < _x + w; i++)
419 {
420 for (int j = _z; j < _z + h; j++)
421 {
422 Cell cell = EClass._map.cells[i, j];
425 value += Card.GetTilePrice(cell.sourceObj, cell.matObj);
428 }
429 }
430 foreach (Thing thing in EClass._map.things)
431 {
432 if (thing.trait.CanCopyInBlueprint && thing.pos.Within(_x, _z, _w, _h) && thing.IsInstalled)
433 {
434 value += thing.GetPrice() * thing.Num;
435 }
436 }
438 }
Definition: Card.cs:11
virtual int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Definition: Card.cs:6449
static int GetTilePrice(TileRow row, SourceMaterial.Row mat)
Definition: Card.cs:6345
bool IsInstalled
Definition: Card.cs:2241
int Num
Definition: Card.cs:154
SourceMaterial.Row matBlock
Definition: Cell.cs:1030
SourceMaterial.Row matRoofBlock
Definition: Cell.cs:1028
SourceMaterial.Row matObj
Definition: Cell.cs:1036
SourceMaterial.Row matBridge
Definition: Cell.cs:1034
SourceMaterial.Row matFloor
Definition: Cell.cs:1032
SourceBlock.Row sourceRoofBlock
Definition: Cell.cs:1050
bool Within(int _x, int _z, int _w, int _h)
Definition: Point.cs:373
virtual bool CanCopyInBlueprint
Definition: Trait.cs:148
void Export(string path, PartialMap partial=null, bool usermap=false)
Definition: Zone.cs:2898

References EClass._map, EClass._zone, Trait.CanCopyInBlueprint, Map.cells, Zone.Export(), Card.GetPrice(), Card.GetTilePrice(), h, Card.IsInstalled, Cell.matBlock, Cell.matBridge, Cell.matFloor, Cell.matObj, Cell.matRoofBlock, Card.Num, offsetX, offsetZ, PathTemp, Card.pos, Cell.sourceBlock, Cell.sourceBridge, Cell.sourceFloor, Cell.sourceObj, Cell.sourceRoofBlock, Map.things, Card.trait, value, w, and Point.Within().

Referenced by AM_Copy.OnAfterProcessTiles().

◆ SavePreview()

static void PartialMap.SavePreview ( string  path,
string  pathDest 
)
inlinestatic

Definition at line 528 of file PartialMap.cs.

529 {
530 EClass.core.actionsNextFrame.Add(delegate
531 {
532 string fileName = CorePath.Temp + "preview.jpg";
533 Texture2D texture2D = ScreenCapture.CaptureScreenshotAsTexture();
534 int num = 200;
535 int num2 = 100;
536 RenderTexture renderTexture = new RenderTexture(num, num2, 0);
537 renderTexture.Create();
538 RenderTexture active = RenderTexture.active;
539 RenderTexture.active = renderTexture;
540 Graphics.Blit(texture2D, renderTexture);
541 Texture2D texture2D2 = new Texture2D(num, num2, texture2D.format, mipChain: false);
542 texture2D2.ReadPixels(new Rect(0f, 0f, num, num2), 0, 0);
543 texture2D2.Apply();
544 RenderTexture.active = active;
545 renderTexture.Release();
546 File.WriteAllBytes(fileName, texture2D2.EncodeToJPG());
547 ZipFile zipFile = ZipFile.Read(path);
548 zipFile.ExtractExistingFile = ExtractExistingFileAction.OverwriteSilently;
549 zipFile.AddFile(fileName, "");
550 zipFile.Save(pathDest);
551 zipFile.Dispose();
552 IO.DeleteFile(fileName);
553 Object.Destroy(texture2D2);
554 Object.Destroy(texture2D);
555 Object.Destroy(renderTexture);
556 });
557 }
List< Action > actionsNextFrame
Definition: BaseCore.cs:31

References BaseCore.actionsNextFrame, EClass.core, and path.

Referenced by ExportDialog().

◆ Update()

void PartialMap.Update ( )
inline

Definition at line 403 of file PartialMap.cs.

404 {
405 if (!path.IsEmpty())
406 {
407 Map.UpdateMetaData(path, this);
408 }
409 }
static void UpdateMetaData(string pathZip, PartialMap partial=null)
Definition: Map.cs:759

References path, and Map.UpdateMetaData().

Referenced by PartialMapMenu.RefreshOptions().

Member Data Documentation

◆ allowRotate

bool PartialMap.allowRotate

◆ baseHeight

int PartialMap.baseHeight

Definition at line 46 of file PartialMap.cs.

Referenced by _Load(), and Apply().

◆ baseHeightWater

int PartialMap.baseHeightWater

Definition at line 49 of file PartialMap.cs.

Referenced by _Load(), and Apply().

◆ cellsMarked

List<Cell> PartialMap.cellsMarked = new List<Cell>()

Definition at line 80 of file PartialMap.cs.

Referenced by Apply(), and ClearMarkedCells().

◆ destX

int PartialMap.destX

Definition at line 64 of file PartialMap.cs.

Referenced by Apply().

◆ destZ

int PartialMap.destZ

Definition at line 66 of file PartialMap.cs.

Referenced by Apply().

◆ dir

int PartialMap.dir

Definition at line 43 of file PartialMap.cs.

Referenced by Apply(), ExportDialog(), FixWall(), and Rotate().

◆ editMode

bool PartialMap.editMode

Definition at line 70 of file PartialMap.cs.

Referenced by Apply().

◆ exportData

ZoneExportData PartialMap.exportData

Definition at line 78 of file PartialMap.cs.

Referenced by Apply().

◆ h

int PartialMap.h

Definition at line 40 of file PartialMap.cs.

Referenced by _Load(), Apply(), Save(), and GenBounds.TryAddMapPiece().

◆ ignoreBlock

bool PartialMap.ignoreBlock

Definition at line 58 of file PartialMap.cs.

Referenced by PartialMapMenu.RefreshOptions(), and GenBounds.TryAddMapPiece().

◆ localOffsetX

int PartialMap.localOffsetX

Definition at line 60 of file PartialMap.cs.

Referenced by Apply(), and Rotate().

◆ localOffsetZ

int PartialMap.localOffsetZ

Definition at line 62 of file PartialMap.cs.

Referenced by Apply(), and Rotate().

◆ map

Map PartialMap.map

Definition at line 76 of file PartialMap.cs.

Referenced by _Load(), and Apply().

◆ name

string PartialMap.name

Definition at line 28 of file PartialMap.cs.

Referenced by _Load(), UIScreenshot.Activate(), and AM_Blueprint.OnSave().

◆ offsetX

int PartialMap.offsetX

Definition at line 31 of file PartialMap.cs.

Referenced by Apply(), and Save().

◆ offsetZ

int PartialMap.offsetZ

Definition at line 34 of file PartialMap.cs.

Referenced by Apply(), and Save().

◆ path

◆ procedural

bool PartialMap.procedural

Definition at line 72 of file PartialMap.cs.

Referenced by Apply().

◆ relative

bool PartialMap.relative
static

Definition at line 25 of file PartialMap.cs.

Referenced by Apply(), AM_Copy.OnClickSubMenu(), and AM_Copy.OnSetSubMenuButton().

◆ result

Result PartialMap.result = new Result()

Definition at line 84 of file PartialMap.cs.

Referenced by Apply(), and GenRoom.Populate().

◆ ruinChance

float PartialMap.ruinChance

Definition at line 74 of file PartialMap.cs.

Referenced by Apply().

◆ validPoints

HashSet<int> PartialMap.validPoints = new HashSet<int>()

Definition at line 82 of file PartialMap.cs.

Referenced by Apply().

◆ value

int PartialMap.value

Definition at line 52 of file PartialMap.cs.

Referenced by Apply(), PartialMapMenu.Refresh(), and Save().

◆ w

int PartialMap.w

Definition at line 37 of file PartialMap.cs.

Referenced by _Load(), Apply(), Save(), and GenBounds.TryAddMapPiece().

Property Documentation

◆ altDirPosition

bool PartialMap.altDirPosition
get

Definition at line 88 of file PartialMap.cs.

Referenced by Apply().

◆ ID

string PartialMap.ID
get

Definition at line 90 of file PartialMap.cs.

◆ PathTemp

string PartialMap.PathTemp
staticget

The documentation for this class was generated from the following file: