(svn r15092) -Fix [NoAI]: make the library internal class name consistant with their directory name
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
/* $Id$ */
|
||||
|
||||
class BinaryHeap extends AILibrary {
|
||||
class Binary_Heap extends AILibrary {
|
||||
function GetAuthor() { return "OpenTTD NoAI Developers Team"; }
|
||||
function GetName() { return "Binary Heap"; }
|
||||
function GetShortName() { return "QUBH"; }
|
||||
function GetDescription() { return "An implementation of a Binary Heap"; }
|
||||
function GetVersion() { return 1; }
|
||||
function GetDate() { return "2008-06-10"; }
|
||||
function CreateInstance() { return "BinaryHeap"; }
|
||||
function CreateInstance() { return "Binary_Heap"; }
|
||||
function GetCategory() { return "Queue"; }
|
||||
}
|
||||
|
||||
RegisterLibrary(BinaryHeap());
|
||||
RegisterLibrary(Binary_Heap());
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* Peek and Pop always return the current lowest value in the list.
|
||||
* Sort is done on insertion and on deletion.
|
||||
*/
|
||||
class BinaryHeap
|
||||
class Binary_Heap
|
||||
{
|
||||
_queue = null;
|
||||
_count = 0;
|
||||
@@ -55,7 +55,7 @@ class BinaryHeap
|
||||
function Exists(item);
|
||||
};
|
||||
|
||||
function BinaryHeap::Insert(item, priority)
|
||||
function Binary_Heap::Insert(item, priority)
|
||||
{
|
||||
/* Append dummy entry */
|
||||
_queue.append(0);
|
||||
@@ -71,7 +71,7 @@ function BinaryHeap::Insert(item, priority)
|
||||
return true;
|
||||
}
|
||||
|
||||
function BinaryHeap::Pop()
|
||||
function Binary_Heap::Pop()
|
||||
{
|
||||
if (_count == 0) return null;
|
||||
|
||||
@@ -86,19 +86,19 @@ function BinaryHeap::Pop()
|
||||
return node[0];
|
||||
}
|
||||
|
||||
function BinaryHeap::Peek()
|
||||
function Binary_Heap::Peek()
|
||||
{
|
||||
if (_count == 0) return null;
|
||||
|
||||
return _queue[0][0];
|
||||
}
|
||||
|
||||
function BinaryHeap::Count()
|
||||
function Binary_Heap::Count()
|
||||
{
|
||||
return _count;
|
||||
}
|
||||
|
||||
function BinaryHeap::Exists(item)
|
||||
function Binary_Heap::Exists(item)
|
||||
{
|
||||
/* Brute-force find the item (there is no faster way, as we don't have the priority number) */
|
||||
foreach (node in _queue) {
|
||||
@@ -110,7 +110,7 @@ function BinaryHeap::Exists(item)
|
||||
|
||||
|
||||
|
||||
function BinaryHeap::_BubbleDown()
|
||||
function Binary_Heap::_BubbleDown()
|
||||
{
|
||||
if (_count == 0) return;
|
||||
|
||||
|
Reference in New Issue
Block a user