public override void Execute(CollectionMap map) { var temp = map.GetCollection(this._filename, this._manager, this._gcareer); if (temp is GCareer gcareer) { var collection = gcareer.GetCollection(this._collection, this._root); if (collection is null) { throw new LookupFailException($"Collection named {this._collection} does not exist"); } if (this._expand is null) { collection.SetValue(this._property, this._value); } else { var part = collection.GetSubPart(this._subpart, this._expand); if (part == null) { throw new Exception($"SubPart named {this._subpart} in node {this._expand} does not exist"); } part.SetValue(this._property, this._value); } } else { throw new Exception($"Object {this._gcareer} is not a GCareer"); } }
public override void Execute(CollectionMap map) { var collection = map.GetCollection(this._filename, this._manager, this._tpk); if (collection is TPKBlock tpk) { var path = Path.Combine(map.Directory, this._path); try { tpk.AddTexture(this._cname, path); } catch { var key = this._key.IsHexString() ? Convert.ToUInt32(this._key, 16) : this._key.BinHash(); // Since was caught, texture does exist tpk.ReplaceTexture(key, KeyType.BINKEY, path); } } else { throw new Exception($"Object {this._tpk} is not a TPKBlock"); } }
public bool Evaluate(CollectionMap map) { try { var collection = map.GetCollection(this._filename, this._manager, this._gcareer); var gcareer = collection as GCareer; var node = gcareer.GetCollection(this._collection, this._root); return(!(node is null)); } catch { return(false); } }
public override void Execute(CollectionMap map) { var collection = map.GetCollection(this._filename, this._manager, this._gcareer); if (collection is GCareer gcareer) { gcareer.CloneCollection(this._to, this._from, this._root); } else { throw new Exception($"Object {this._gcareer} is not a GCareer"); } }
public override void Execute(CollectionMap map) { var collection = map.GetCollection(this._filename, this._manager, this._str); if (collection is STRBlock str) { str.AddRecord(this._key, this._label, this._text); } else { throw new Exception($"Object {this._str} is not a STRBlock"); } }
public override void Execute(CollectionMap map) { var collection = map.GetCollection(this._filename, this._manager, this._tpk); if (collection is TPKBlock tpk) { var path = Path.Combine(map.Directory, this._path); tpk.AddTexture(this._cname, path); } else { throw new Exception($"Object {this._tpk} is not a TPKBlock"); } }
public bool Evaluate(CollectionMap map) { try { var key = this._texture.IsHexString() ? Convert.ToUInt32(this._texture, 16) : this._texture.BinHash(); var collection = map.GetCollection(this._filename, this._manager, this._tpk); var tpk = collection as TPKBlock; return(!(tpk.FindTexture(key, KeyType.BINKEY) is null)); } catch { return(false); } }
public bool Evaluate(CollectionMap map) { try { var collection = map.GetCollection(this._filename, this._manager, this._str); var str = collection as STRBlock; var key = this._record.IsHexString() ? Convert.ToUInt32(this._record, 16) : this._record.BinHash(); return(!(str.GetRecord(key) is null)); } catch { return(false); } }
public bool Evaluate(CollectionMap map) { try { var key = this._texture.IsHexString() ? Convert.ToUInt32(this._texture, 16) : this._texture.BinHash(); var collection = map.GetCollection(this._filename, this._manager, this._tpk); var tpk = collection as TPKBlock; var check = tpk.FindTexture(key, KeyType.BINKEY).GetValue(this._property); return(String.Compare(check, this._value, StringComparison.Ordinal) == 0); } catch { return(false); } }
public bool Evaluate(CollectionMap map) { try { var collection = map.GetCollection(this._filename, this._manager, this._str); var str = collection as STRBlock; var key = this._record.IsHexString() ? Convert.ToUInt32(this._record, 16) : this._record.BinHash(); var check = str.GetRecord(key).GetValue(this._property); return(String.Compare(check, this._value, StringComparison.Ordinal) == 0); } catch { return(false); } }
public override void Execute(CollectionMap map) { var collection = map.GetCollection(this._filename, this._manager, this._tpk); if (collection is TPKBlock tpk) { var key = this._texture.IsHexString() ? Convert.ToUInt32(this._texture, 16) : this._texture.BinHash(); tpk.RemoveTexture(key, KeyType.BINKEY); } else { throw new Exception($"Object {this._tpk} is not a TPKBlock"); } }
public override void Execute(CollectionMap map) { var collection = map.GetCollection(this._filename, this._manager, this._str); if (collection is STRBlock str) { var key = this._record.IsHexString() ? Convert.ToUInt32(this._record, 16) : this._record.BinHash(); str.RemoveRecord(key); } else { throw new Exception($"Object {this._str} is not a STRBlock"); } }
public override void Execute(CollectionMap map) { var collection = map.GetCollection(this._filename, this._manager, this._tpk); if (collection is TPKBlock tpk) { var directory = Path.Combine(map.Directory, this._path); if (!Directory.Exists(directory)) { throw new DirectoryNotFoundException($"Directory with path {directory} does not exist"); } this.BindTextures(directory, tpk); } else { throw new Exception($"Object {this._tpk} is not a TPKBlock"); } }
public bool Evaluate(CollectionMap map) { try { var collection = map.GetCollection(this._filename, this._manager, this._collection); if (this._expand is null) { var check = collection.GetValue(this._property); return(String.Compare(check, this._value, StringComparison.Ordinal) == 0); } else { var part = collection.GetSubPart(this._subpart, this._expand); var check = part.GetValue(this._property); return(String.Compare(check, this._value, StringComparison.Ordinal) == 0); } } catch { return(false); } }
public override void Execute(CollectionMap map) { var collection = map.GetCollection(this._filename, this._manager, this._str); if (collection is STRBlock str) { try { str.AddRecord(this._key, this._label, this._value); } catch { // Prioritize label to key // We can be confident that record is not null b/c of exception var record = str.GetRecord(this._label.BinHash()); record.SetValue("Text", this._value); } } else { throw new Exception($"Object {this._str} is not a STRBlock"); } }
public override void Execute(CollectionMap map) { var collection = map.GetCollection(this._filename, this._manager, this._str); if (collection is STRBlock str) { var key = this._record.IsHexString() ? Convert.ToUInt32(this._record, 16) : this._record.BinHash(); var record = str.GetRecord(key); if (record is null) { throw new LookupFailException($"String with key 0x{key:X8} does not exist"); } record.SetValue(this._property, this._value); } else { throw new Exception($"Object {this._str} is not a STRBlock"); } }
public override void Execute(CollectionMap map) { var collection = map.GetCollection(this._filename, this._manager, this._collection); if (this._expand is null) { collection.SetValue(this._property, this._value); if (this._property == "CollectionName") { map.RemoveCollection(this._filename, this._manager, this._collection); map.AddCollection(this._filename, this._manager, this._value, collection); } } else { var part = collection.GetSubPart(this._subpart, this._expand); if (part == null) { throw new Exception($"SubPart named {this._subpart} in node {this._expand} does not exist"); } part.SetValue(this._property, this._value); } }
public override void Execute(CollectionMap map) { var collection = map.GetCollection(this._filename, this._manager, this._tpk); if (collection is TPKBlock tpk) { var key = this._texture.IsHexString() ? Convert.ToUInt32(this._texture, 16) : this._texture.BinHash(); var texture = tpk.FindTexture(key, KeyType.BINKEY); if (texture is null) { throw new LookupFailException($"Texture with key 0x{key:X8} does not exist"); } texture.SetValue(this._property, this._value); } else { throw new Exception($"Object {this._tpk} is not a TPKBlock"); } }
public bool Evaluate(CollectionMap map) { try { map.GetCollection(this._filename, this._manager, this._collection); return(true); } catch { return(false); } }