コード例 #1
0
ファイル: Relay.cs プロジェクト: Niker323/VS-mods
    //public override void GetBlockInfo(IPlayer forPlayer, StringBuilder dsc)
    //{
    //    base.GetBlockInfo(forPlayer, dsc);
    //    if (energyStorage != null)
    //    {
    //        dsc.AppendLine(energyStorage.GetFluxStorageInfo());
    //    }
    //}

    public override void FromTreeAttributes(ITreeAttribute tree, IWorldAccessor worldForResolving)
    {
        base.FromTreeAttributes(tree, worldForResolving);

        if (energyStorage == null)
        {
            energyStorage = new FluxStorage(MyMiniLib.GetAttributeInt(Block, "transfer", 10000), MyMiniLib.GetAttributeInt(Block, "transfer", 10000), MyMiniLib.GetAttributeInt(Block, "transfer", 10000));
        }
        energyStorage.setEnergy(tree.GetFloat("energy"));
        state = tree.GetBool("state", false);
    }