예제 #1
0
 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");
 }
예제 #2
0
        public override void readFromNbt(NbtCompound tag)
        {
            base.readFromNbt(tag);

            this.heldResources = tag.getInt("builderResources");
        }
예제 #3
0
 public Trainee(NbtCompound tag)
 {
     this.info = new WorkerInfo(tag.getCompound("info"));
     this.type = Main.instance.workerTypeRegistry.getElement(tag.getInt("type"));
 }
예제 #4
0
        public override void readFromNbt(NbtCompound tag)
        {
            base.readFromNbt(tag);

            this.health = tag.getInt("health");
        }
예제 #5
0
 public void readFromNbt(NbtCompound tag)
 {
     this.plateState = (EnumPlateState)tag.getInt("plateState");
 }
예제 #6
0
        public override void readFromNbt(NbtCompound tag)
        {
            base.readFromNbt(tag);

            this.team = Team.getTeamFromId(tag.getInt("teamId"));
        }
예제 #7
0
    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);
    }
예제 #8
0
 public override void readFromNbt(NbtCompound tag)
 {
     this.value = tag.getInt(this.saveName);
 }
예제 #9
0
 public void readFromNbt(NbtCompound tag)
 {
     this.heldItem = Main.instance.itemRegistry.getElement(tag.getInt("heldItemId", -1)); // -1 results in null being returned
 }
예제 #10
0
 public Candidate(NbtCompound tag)
 {
     this.info = new WorkerInfo(tag.getCompound("info"));
     this.type = Main.instance.workerTypeRegistry.getElement(tag.getInt("type"));
     this.endAvailabilityTime = tag.getDouble("endAvailabilityTime");
 }
예제 #11
0
    public override void readFromNbt(NbtCompound tag)
    {
        base.readFromNbt(tag);

        this.teamID = tag.getInt("teamId"); // TODO Should the setter be called here?
    }
예제 #12
0
 /// <summary>
 /// Creates a new map data from NBT.
 /// </summary>
 public MapData(NbtCompound tag)
 {
     this.saveName = tag.getString("mapName");
     this.seed     = tag.getInt("seed");
 }
예제 #13
0
 public void readFromNbt(NbtCompound tag)
 {
     this._time           = tag.getDouble("time");
     this.multiplyerIndex = Mathf.Clamp(tag.getInt("multiplyerIndex"), 0, this._timeMultipliers.Length - 1);
 }