ID versus Type - Printable Version +- Cuberite Forum (https://forum.cuberite.org) +-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html) +--- Forum: Development (https://forum.cuberite.org/forum-13.html) +--- Thread: ID versus Type (/thread-588.html) |
ID versus Type - xoft - 10-20-2012 I know this is just a rant, but it's been bugging me ever since, so why not let the steam out? Maybe people will understand my OCD over the sources I feel there's a difference between an ID and a type. ID is something that uniquely identifies one single instance. Type is something that describes some general properties shared between several instances. So for instance an entity has an ID, which uniquely identifies the one entity, and a type that says what it should behave as. So why do we keep using BlockID and ItemID, when, in fact, they are BlockType and ItemType? BlockID, in the logic described above, would be the set of 3 coordinates - that's how you identify one single block. On the other hand, whether that block is dirt or stone, that is clearly a type - several blocks share that property. That's why I keep changing all the BlockIDs and ItemIDs in the sources into BlockTypes and ItemTypes. RE: ID versus Type - FakeTruth - 10-20-2012 I agree. However BlockID should be read as block type ID, yeah now it makes sense again But even if you read it as that, it's deprecated. Now there can be blocks with a single 'type' that are still different by using meta/health values |