/// <summary> /// Reads the object from NBT and sets it's state. /// </summary> public virtual void readFromNbt(NbtCompound tag) { // Don't read id from NBT. this.transform.position = tag.getVector3("position"); this.transform.eulerAngles = tag.getVector3("eulerRotation"); this.transform.localScale = tag.getVector3("localScale", Vector3.one); this.immutable = tag.getBool("isImmutable"); this.guid = new Guid(tag.getString("guid")); }
public void readFromNbt(NbtCompound tag) { NbtList tagList = tag.getList("entries"); foreach (NbtCompound compound in tagList) { this.entires.Add(new Entry(compound)); } this.isPrimary = tag.getBool("isPrimary"); this.constructionTime = tag.getFloat("constructionTime"); }
public override void readFromNbt(NbtCompound tag) { base.readFromNbt(tag); this.lastPos = tag.getVector3("lastPos"); this.unitStats = new UnitStats(tag, this.getData()); bool flag = tag.getBool("hasMovementOverride"); if (flag) { this.overrideMovementDestination = tag.getVector3("overrideMovementDestination"); this.overrideMovementStopDis = tag.getFloat("overrideMovementStopDis"); } }
public override void readFromNbt(NbtCompound tag) { base.readFromNbt(tag); this.energy.value = tag.getFloat("energy"); this.hunger.value = tag.getFloat("hunger"); this.temperature.value = tag.getFloat("temperature"); this.happiness.value = tag.getFloat("happiness"); this.isDead = tag.getBool("isDead"); this.info = new WorkerInfo(tag.getCompound("workerInfo")); this.setType(Main.instance.workerTypeRegistry.getElement(tag.getInt("workerType"))); // Read Ai Meta objects from NBT foreach (IAiMeta meta in this.GetComponentsInChildren <IAiMeta>()) { meta.readFromNbt(tag); } }
public override void readFromNbt(NbtCompound tag) { base.readFromNbt(tag); this.lastPos = tag.getVector3("lastPos"); this.unitStats = new UnitStats(tag, this.unitData); bool flag = tag.getBool("hasMovementOverride"); if (flag) { this.overrideMovementDestination = tag.getVector3("overrideMovementDestination"); this.overrideMovementStopDis = tag.getFloat("overrideMovementStopDis"); this.moveHelper.setDestination((Vector3)this.overrideMovementDestination, this.overrideMovementStopDis); } NbtCompound tagTask = tag.getCompound("task"); ITask task = (ITask)Activator.CreateInstance(TaskManager.getTaskFromId(tagTask.getInt("taskID")), new object[] { (UnitBase)this }); task.readFromNbt(tagTask); this.setTask(task, true); }
public void readFromNbt(NbtCompound tag) { this.isFlipped = tag.getBool("isSwitchCurved"); }
public Entry(NbtCompound tag) { this.cell = Main.instance.tileRegistry.getElement(tag.getInt("cellId")); this.position = new Position(tag.getVector3Int("offset")); this.addFogOnComplete = tag.getBool("addFog"); }
public void readFromNbt(NbtCompound tag) { this.unlocked = tag.getBool("unlocked"); }
public void readFromNbt(NbtCompound tag) { this.isTripped = tag.getBool("isTripped"); //this.tripTimer = tag.getFloat("tripTimer"); }
public void readFromNbt(NbtCompound tag) { this.isOn = tag.getBool("isLeverOn"); }