goostengine / goost

A general-purpose, extensible and customizable C++ extension for Godot Engine.
https://goostengine.github.io/
MIT License
481 stars 18 forks source link

Rename `VariantMap` and `VariantResource` classes #182

Closed Xrayez closed 2 years ago

Xrayez commented 2 years ago

Part of #176.

VariantMapMap2D

This class was first renamed from Grid2D in https://github.com/goostengine/goost/pull/67 to avoid confusion with GridRect. After using the class more, it becomes apparent that Map2D better reflects the functionality here, because it allows to map 2D Cartesian coordinates to values. Map3D could also be implemented.

This should also signify that the API may be similar to TileMap, BitMap, Image (technically a PixMap, you may see this name in some image processing libraries).

This also avoids using Variant in a class name, which is frankly redundant.

VariantResourceDataContainer

  1. The Resource is described as a class intended to be used as a data container. Because DataContainer is a Resource that handles any Variant data, it makes sense to name it that way.
  2. Godot has a similar PackedDataContainer, which packs Variant as PoolByteArray.
  3. Avoids using Variant in a class name, which is redundant (same as in VariantMap renamed to Map2D).