Changeset - r15764:3052b6813193
[Not reviewed]
master
0 2 0
rubidium - 14 years ago 2010-08-11 18:50:23
rubidium@openttd.org
(svn r20448) -Codechange: make some functions that can be const const
2 files changed with 8 insertions and 8 deletions:
0 comments (0 inline, 0 general)
src/newgrf_commons.cpp
Show inline comments
 
@@ -92,7 +92,7 @@ void OverrideManagerBase::ResetOverride(
 
 * @param grfid ID of the grf file
 
 * @return the ID of the candidate, of the Invalid flag item ID
 
 */
 
uint16 OverrideManagerBase::GetID(uint8 grf_local_id, uint32 grfid)
 
uint16 OverrideManagerBase::GetID(uint8 grf_local_id, uint32 grfid) const
 
{
 
	const EntityIDMapping *map;
 

	
 
@@ -146,7 +146,7 @@ uint16 OverrideManagerBase::AddEntityID(
 
 * @param entity_id of the entity being queried
 
 * @return mapped id
 
 */
 
uint16 OverrideManagerBase::GetSubstituteID(uint16 entity_id)
 
uint16 OverrideManagerBase::GetSubstituteID(uint16 entity_id) const
 
{
 
	return mapping_ID[entity_id].substitute_id;
 
}
 
@@ -185,7 +185,7 @@ void HouseOverrideManager::SetEntitySpec
 
 * @param grfid ID of the grf file
 
 * @return the ID of the candidate, of the Invalid flag item ID
 
 */
 
uint16 IndustryOverrideManager::GetID(uint8 grf_local_id, uint32 grfid)
 
uint16 IndustryOverrideManager::GetID(uint8 grf_local_id, uint32 grfid) const
 
{
 
	uint16 id = OverrideManagerBase::GetID(grf_local_id, grfid);
 
	if (id != invalid_ID) return id;
src/newgrf_commons.h
Show inline comments
 
@@ -65,11 +65,11 @@ public:
 
	void Add(uint8 local_id, uint32 grfid, uint entity_type);
 
	virtual uint16 AddEntityID(byte grf_local_id, uint32 grfid, byte substitute_id);
 

	
 
	uint16 GetSubstituteID(uint16 entity_id);
 
	virtual uint16 GetID(uint8 grf_local_id, uint32 grfid);
 
	uint16 GetSubstituteID(uint16 entity_id) const;
 
	virtual uint16 GetID(uint8 grf_local_id, uint32 grfid) const;
 

	
 
	inline uint16 GetMaxMapping() { return max_new_entities; }
 
	inline uint16 GetMaxOffset() { return max_offset; }
 
	inline uint16 GetMaxMapping() const { return max_new_entities; }
 
	inline uint16 GetMaxOffset() const { return max_offset; }
 
};
 

	
 

	
 
@@ -89,7 +89,7 @@ public:
 
			OverrideManagerBase(offset, maximum, invalid) {}
 

	
 
	virtual uint16 AddEntityID(byte grf_local_id, uint32 grfid, byte substitute_id);
 
	virtual uint16 GetID(uint8 grf_local_id, uint32 grfid);
 
	virtual uint16 GetID(uint8 grf_local_id, uint32 grfid) const;
 
	void SetEntitySpec(IndustrySpec *inds);
 
};
 

	
0 comments (0 inline, 0 general)