Esempio n. 1
0
    /**
     * Reads data into the tile entity when loaded.
     */

    public override void read(BinaryReader _br, StreamModeRead _eStreamMode)
    {
        base.read(_br, _eStreamMode);
        string collectionString = _br.ReadString();

        this.collection = TransformationCollection.Read(collectionString, useHash);
        string tQueueString = _br.ReadString();

        this.tQueue                    = tQueue.Read(tQueueString, useHash);
        this.requiresPower             = _br.ReadBoolean();
        this.powerSources              = StringHelpers.WriteStringToList(_br.ReadString());
        this.requiresHeat              = _br.ReadBoolean();
        this.heatSources               = StringHelpers.WriteStringToList(_br.ReadString());
        this.requiresNearbyBlocks      = _br.ReadBoolean();
        this.nearbyBlockTags           = StringHelpers.WriteStringToList(_br.ReadString());
        this.nearbyBlockRequireAllTags = _br.ReadBoolean();
        this.nearbyBlockNames          = StringHelpers.WriteStringToList(_br.ReadString());
        this.nearbyBlocksNeeded        = _br.ReadInt32();
        this.nearbyBlockRange          = StringHelpers.WriteStringToVector3i(_br.ReadString());

        // After read:
        this.hasPower        = false;
        this.hasHeat         = false;
        this.hasNearbyBlocks = false;
        this.userAccessing   = false;
        this.CalculateLookupCoordinates();
        this.random = RandomStatic.Range(0, 20);
    }
Esempio n. 2
0
    /**
     * Reads data into the tile entity when loaded.
     */

    public override void read(BinaryReader _br, StreamModeRead _eStreamMode)
    {
        base.read(_br, _eStreamMode);
        string collectionString = _br.ReadString();

        this.collection = TransformationCollection.Read(collectionString, useHash);
        string tQueueString = _br.ReadString();

        this.tQueue        = tQueue.Read(tQueueString, useHash);
        this.requiresPower = _br.ReadBoolean();
        this.powerSources  = StringHelpers.WriteStringToList(_br.ReadString());
        this.requiresHeat  = _br.ReadBoolean();
        this.heatSources   = StringHelpers.WriteStringToList(_br.ReadString());
    }