# Storage classes (/start/stored-classes)



Pixi’VN provides an abstract class [`StoredClassModel`](/jsdoc/pixi-vn/index/classes/StoredClassModel) that you can use to create classes with properties saved in the game storage.

```ts
const CITY_CATEGORY = "city";

export default class City extends StoredClassModel {
    constructor(id: string, props: CityProps) {
        super(CITY_CATEGORY, id);
        // ...
    }
}
```

```ts
const milan = new City("milan", {
    // ...
});
```

## Storate properties [#storate-properties]

To stored class properties in the game storage use the [`getStorageProperty`](/jsdoc/pixi-vn/index/classes/StoredClassModel#getstorageproperty) and [`setStorageProperty`](/jsdoc/pixi-vn/index/classes/StoredClassModel#setstorageproperty) helpers.

```ts
export default class City extends StoredClassModel {
    constructor(id: string, props: CityProps) {
        // ...
    }

    get inhabitants(): number {
        return this.getStorageProperty<string>("inhabitants") || "";
    }
    set inhabitants(value: number) {
        this.setStorageProperty("inhabitants", value);
    }
}
```

```ts
const milan = new City("milan", {
    // ...
});

milan.inhabitants = 100000;
```
