Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename VariantMap and VariantResource classes #182

Merged
merged 2 commits into from
Feb 20, 2022

Conversation

Xrayez
Copy link
Contributor

@Xrayez Xrayez commented Feb 20, 2022

Part of #176.

VariantMapMap2D

This class was first renamed from Grid2D in #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).

@Xrayez Xrayez added enhancement Improvement of existing features breaks compat Compatibility breakage topic:core labels Feb 20, 2022
@Xrayez Xrayez added this to the 2.0-gd3 milestone Feb 20, 2022
This class was first renamed from `Grid2D` in #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.

This also avoids using `Variant` in a class name, which is frankly redundant.
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` now).
@Xrayez Xrayez force-pushed the prune-variant-from-class-names branch from 0a31c7d to e761daa Compare February 20, 2022 14:11
@Xrayez Xrayez merged commit 6f08ab4 into gd3 Feb 20, 2022
@Xrayez Xrayez deleted the prune-variant-from-class-names branch February 20, 2022 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaks compat Compatibility breakage enhancement Improvement of existing features topic:core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant