package org.cyclops.integrateddynamics.core.evaluate.variable;

import lombok.ToString;
import net.minecraft.util.text.TextFormatting;
import org.cyclops.cyclopscore.helper.Helpers;

/**
 * Value type with values that are strings.
 * @author rubensworks
 */
public class ValueTypeString extends ValueTypeBase<ValueTypeString.ValueString> {

    public ValueTypeString() {
        super("string", Helpers.RGBToInt(250, 10, 13), TextFormatting.RED.toString());
    }

    @Override
    public ValueString getDefault() {
        return ValueString.of("");
    }

    @Override
    public String toCompactString(ValueString value) {
        return value.getRawValue();
    }

    @Override
    public String serialize(ValueString value) {
        return value.getRawValue();
    }

    @Override
    public ValueString deserialize(String value) {
        return ValueString.of(value);
    }

    @ToString
    public static class ValueString extends ValueBase {

        private final String value;

        private ValueString(String value) {
            super(ValueTypes.STRING);
            this.value = value;
        }

        public static ValueString of(String value) {
            return new ValueString(value);
        }

        public String getRawValue() {
            return value;
        }

        @Override
        public boolean equals(Object o) {
            return o instanceof ValueString && ((ValueString) o).value.equals(this.value);
        }

        @Override
        public int hashCode() {
            return getType().hashCode() + value.hashCode();
        }
    }

}

@@ -174,16 +174,93 @@
 Helpers;
+%0Aimport org.cyclops.integrateddynamics.api.evaluate.variable.IValueTypeNamed;
 %0A%0A/**%0A *
@@ -407,16 +407,80 @@
 eString%3E
+%0A        implements IValueTypeNamed%3CValueTypeString.ValueString%3E
  %7B%0A%0A    
@@ -1018,24 +1018,120 @@
 ue);%0A    %7D%0A%0A
+    @Override%0A    public String getName(ValueString a) %7B%0A        return a.getRawValue();%0A    %7D%0A%0A
     @ToStrin

Make strings part of the 'to string' value type