Mise à jour du dépôt en fonction du .gitignore
This commit is contained in:
parent
1f0f033fad
commit
4a59748e67
224 changed files with 6785 additions and 0 deletions
47
LandblockExtraction/DatEngine/PortalEngine.cs
Normal file
47
LandblockExtraction/DatEngine/PortalEngine.cs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
using AC2RE.Definitions;
|
||||
|
||||
namespace LandblockExtraction.DatEngine {
|
||||
public class PortalEngine {
|
||||
private readonly DataId TERRAINDESCID = new DataId(0x12000000);
|
||||
private readonly DataId SURFACEDESCID = new DataId(0x13000000);
|
||||
private readonly DataId LANDSCAPEID = new DataId(0x36000000);
|
||||
|
||||
private DatReader portalReader;
|
||||
|
||||
public CTerrainDesc cTerrainDesc { get; private set; }
|
||||
public CSurfaceDesc cSurfaceDesc { get; private set; }
|
||||
public LandScapeDefs landScapeDefs { get; private set; }
|
||||
|
||||
public PortalEngine() {
|
||||
portalReader = new(@"X:\DatFiles\portal.dat");
|
||||
InitTerrainDesc();
|
||||
InitSurfaceDesc();
|
||||
InitLandScapeDesc();
|
||||
}
|
||||
|
||||
public bool InitTerrainDesc() {
|
||||
if (!portalReader.contains(TERRAINDESCID)) return false;
|
||||
using (var data = portalReader.getFileReader(TERRAINDESCID)) {
|
||||
if (data == null) return false;
|
||||
cTerrainDesc = new(data);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public bool InitSurfaceDesc() {
|
||||
if (!portalReader.contains(SURFACEDESCID)) return false;
|
||||
using (var data = portalReader.getFileReader(SURFACEDESCID)) {
|
||||
if (data == null) return false;
|
||||
cSurfaceDesc = new(data);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public bool InitLandScapeDesc() {
|
||||
if (!portalReader.contains(LANDSCAPEID)) return false;
|
||||
using (var data = portalReader.getFileReader(LANDSCAPEID)) {
|
||||
if (data == null) return false;
|
||||
landScapeDefs = new(data);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue