Skip to content
Jimmy Cushnie edited this page Jun 11, 2019 · 6 revisions

SUCC files have pretty flexible formatting. SUCC.FileStyle is a class that allows you to customize the format, or "style", of data that is saved. This does NOT affect what the data is when it is loaded again, it only changes how the file looks when you open it with a text editor.

Each DataFile has a FileStyle. This can be set in the DataFile constructor or after the object has been created. If you don't specify a style for your file, it will use FileStyle.Default (which you can modify if you want).

IndentationInterval

Default: 4
Range: 1 - infinity

The number of spaces that make up an indentation in a file. See File Structure for more details.

# This file was saved with the default IndentationInterval of 4.
Colors:
    red:
        r: 255
        g: 0
        b: 0
    green:
        r: 0
        g: 255
        b: 0
# This file was saved with an IndentationInverval of 2.
Colors:
  red:
    r: 255
    g: 0
    b: 0
  green:
    r: 0
    g: 255
    b: 0

SpacesAfterColon

Default: 1
Range: 0 - infinity

The number of spaces after the colon in key nodes that have a value. See File Structure for more details.

# This file was saved with the default SpacesAfterColon of 1.
Number of Arms: 2
Number of Eyes: 2
Number of Hips: 2
Number of Ears: 2
This file was saved with a SpacesAfterColon of 0.
Number of Arms:2
Number of Eyes:2
Number of Hips:2
Number of Ears:2

SpacesAfterDash

Default: 1
Range: 0 - infinity

The number of spaces after the dash in list nodes that have a value. See File Structure for more details.

# This file was saved with the default SpacesAfterDash of 1.
Beverages:
    - milk
    - water
    - blood
    - orange juice
# This file was saved with a SpacesAfterDash of 4.
Beverages:
    -    milk
    -    water
    -    blood
    -    orange juice

AlwaysQuoteStrings

Default: false
Range: true, false

Strings saved by SUCC can be "quoted" when saved in a file and the quotes will be ignored when the file is read. See Base Types#String for more details. If AlwaysQuoteStrings is true, saved strings will be always be "quoted." Otherwise, saved strings will only be quoted when necessary to preserve that data.

# This file was saved with AlwaysQuoteStrings set to false.
Strings:
    - Hello World
    - I am trained in gorilla warfare
    - "   spaces   " # this needs to be quoted to preserve the spaces at the beginning and end
# This file was saved with AlwaysQuoteStrings set to true.
Strings:
    - "Hello World"
    - "I am trained in gorilla warfare"
    - "   spaces   "

BoolStyle

Default: BoolStyle.true_false
Range: BoolStyle.true_false, BoolStyle.on_off, BoolStyle.yes_no, BoolStyle.y_n

Bools can be read by SUCC in a couple different ways. See Base Types#Boolean for more details. This property controls how they are saved.

# This file was saved with BoolStyle set to BoolStyle.true_false
I love ice cream: true
I hate ice cream: false
# This file was saved with BoolStyle set to BoolStyle.on_off
I love ice cream: on
I hate ice cream: off
# This file was saved with BoolStyle set to BoolStyle.yes_no
I love ice cream: yes
I hate ice cream: no
# This file was saved with BoolStyle set to BoolStyle.y_n
I love ice cream: y
I hate ice cream: n

EnumStyle

Default: EnumStyle.name
Range: EnumStyle.name, EnumStyle.number

Enums can be read by SUCC as either their name or the number representing their underlying type. See Base Types#Enum for more details. This property controls how they are saved.

enum KeyboardStyle
{
    qwerty,
    azerty,
    dvorak,
    colemak,
}
# This file was saved with EnumStyle set to EnumStyle.name
user1 keyboard layout: qwerty
user2 keyboard layout: dvorak
# This file was saved with EnumStyle set to EnumStyle.number
user1 keyboard layout: 0
user2 keyboard layout: 2

AlwaysArrayDictionaries

Default: false
Range: true, false

There are two ways SUCC can save and load dictionaries: the standard way, and as an array of KeyValuePairs. See Collection Types#Dictionary for more information.

If AlwaysArrayDictionaries is false, dictionaries will only be saved as arrays when necessary, and will otherwise prefer the standard way. If AlwaysArrayDictionaries is true, dictionaries will always be saved as arrays. It can be beneficial to turn this on if you want to make sure your dictionaries are always saved in a consistent format.

var dicc = new Dictionary<int, string>()
{
    [69] = "sex lmao",
    [10] = "decimal is a very in-tens base",
    [22] = "a bomb-ass Taylor Swift song",
};
# This file was saved with AlwaysArrayDictionaries set to false.
dicc:
    69: sex lmao
    10: decimal is a very in-tens base
    22: a bomb-ass Taylor Swift song
# This file was saved with AlwaysArrayDictionaries set to true.
dicc:
    -
        key: 69
        value: sex lmao
    -
        key: 10
        value: decimal is a very in-tens base
    -
        key: 22
        value: a bomb-ass Taylor Swift song