コード例 #1
0
ファイル: nodelist.hpp プロジェクト: Ayutac/OpenTTD
	/** remove and return the open node specified by a key */
	inline Titem_& PopOpenNode(const Key& key)
	{
		Titem_& item = m_open.Pop(key);
		uint idxPop = m_open_queue.FindIndex(item);
		m_open_queue.Remove(idxPop);
		return item;
	}
コード例 #2
0
ファイル: nodelist.hpp プロジェクト: Ayutac/OpenTTD
	/** insert given item as open node (into m_open and m_open_queue) */
	inline void InsertOpenNode(Titem_& item)
	{
		assert(m_closed.Find(item.GetKey()) == NULL);
		m_open.Push(item);
		m_open_queue.Include(&item);
		if (&item == m_new_node) {
			m_new_node = NULL;
		}
	}
コード例 #3
0
ファイル: nodelist.hpp プロジェクト: Ayutac/OpenTTD
	/** remove and return the best open node */
	inline Titem_ *PopBestOpenNode()
	{
		if (!m_open_queue.IsEmpty()) {
			Titem_ *item = m_open_queue.Shift();
			m_open.Pop(*item);
			return item;
		}
		return NULL;
	}
コード例 #4
0
ファイル: nodelist.hpp プロジェクト: Ayutac/OpenTTD
	/** return number of open nodes */
	inline int OpenCount()
	{
		return m_open.Count();
	}
コード例 #5
0
ファイル: nodelist.hpp プロジェクト: Ayutac/OpenTTD
	/** close node */
	inline void InsertClosedNode(Titem_& item)
	{
		assert(m_open.Find(item.GetKey()) == NULL);
		m_closed.Push(item);
	}
コード例 #6
0
ファイル: nodelist.hpp プロジェクト: Ayutac/OpenTTD
	/** return the open node specified by a key or NULL if not found */
	inline Titem_ *FindOpenNode(const Key& key)
	{
		Titem_ *item = m_open.Find(key);
		return item;
	}
コード例 #7
0
	/** return number of open nodes */
	FORCEINLINE int OpenCount()
	{
		return m_open.Count();
	}
コード例 #8
0
	/** return the open node specified by a key or NULL if not found */
	FORCEINLINE Titem_ *FindOpenNode(const Key& key)
	{
		Titem_ *item = m_open.Find(key);
		return item;
	}