Exemplo n.º 1
0
 protected override void ReadInternal(Reader reader)
 {
     index_of_info = reader.ReadUInt16();
     type          = reader.ReadUInt16();
     value         = new DsgVarValue(index_of_info, type);
     value.Read(reader);
 }
Exemplo n.º 2
0
 public Value(OpenSpace.ROM.DsgVarValue value)
 {
     this.valROM = value;
     if (value != null)
     {
         InitValue(value);
     }
 }
Exemplo n.º 3
0
            public Entry(Reader reader, ushort index_of_info)
            {
                offset = Pointer.Current(reader);

                type  = reader.ReadUInt16();
                value = new DsgVarValue(index_of_info, type);
                value.Read(reader);

                offsetInBuffer = reader.ReadUInt16();
            }
Exemplo n.º 4
0
            public void InitValue(OpenSpace.ROM.DsgVarValue value)
            {
                this.type = value.dsgVarType;

                if (DsgVarInfoEntry.GetDsgVarTypeFromArrayType(type) != DsgVarInfoEntry.DsgVarType.None)
                {
                    AsArray = new Value[value.ValueArrayLength];
                    for (int i = 0; i < AsArray.Length; i++)
                    {
                        AsArray[i] = null;
                    }
                }
            }
Exemplo n.º 5
0
        public bool IsSameValue(DsgVarValue other)
        {
            if (other == null)
            {
                return(false);
            }
            if (Equals(other))
            {
                return(true);
            }
            if (dsgVarType != other.dsgVarType)
            {
                return(false);
            }
            switch (dsgVarType)
            {
            case DsgVarType.Boolean:
                return(ValueBoolean == other.ValueBoolean);

            case DsgVarType.Byte:
                return(ValueByte == other.ValueByte);

            case DsgVarType.UByte:
                return(ValueUByte == other.ValueUByte);

            case DsgVarType.Short:
                return(ValueShort == other.ValueShort);

            case DsgVarType.UShort:
                return(ValueUShort == other.ValueUShort);

            case DsgVarType.Int:
                return(ValueInt == other.ValueInt);

            case DsgVarType.UInt:
                return(ValueUInt == other.ValueUInt);

            case DsgVarType.Float:
                return(ValueFloat == other.ValueFloat);

            case DsgVarType.Vector:
                return(ValueVector == other.ValueVector);

            case DsgVarType.Text:
                return(ValueText == other.ValueText);

            case DsgVarType.Graph:
                return(ValueGraph == other.ValueGraph);

            case DsgVarType.WayPoint:
                return(ValueWayPoint == other.ValueWayPoint);

            case DsgVarType.GameMaterial:
                return(ValueGameMaterial == other.ValueGameMaterial);

            case DsgVarType.List:
                if (ValueList.curLength != other.ValueList.curLength ||
                    ValueList.maxLength != other.ValueList.maxLength)
                {
                    return(false);
                }
                for (int i = 0; i < ValueList.maxLength; i++)
                {
                    if (ValueList.list[i].value != other.ValueList.list[i].value)
                    {
                        return(false);
                    }
                }
                return(true);

            case DsgVarType.Comport:
                return(ValueComport == other.ValueComport);

            case DsgVarType.Perso:
                return(ValuePerso == other.ValuePerso);

            case DsgVarType.Action:
                return(ValueAction == other.ValueAction);

            case DsgVarType.Caps:
                return(ValueCaps == other.ValueCaps);

            // Arrays
            case DsgVarType.ActionArray:
            case DsgVarType.FloatArray:
            case DsgVarType.IntegerArray:
            case DsgVarType.PersoArray:
            case DsgVarType.SoundEventArray:
            case DsgVarType.SuperObjectArray:
            case DsgVarType.TextArray:
            case DsgVarType.TextRefArray:
            case DsgVarType.VectorArray:
            case DsgVarType.WayPointArray:
            case DsgVarType.GraphArray:
            case DsgVarType.VisualMatArray:
            case DsgVarType.SOLinksArray:
                if (ValueArrayLength != other.ValueArrayLength)
                {
                    return(false);
                }
                return(true);
            }
            return(true);
        }