List  version
 All Classes Functions
Public Member Functions | List of all members
List Class Reference

Valuator libraries. More...

Public Member Functions

constructor List (list=null)
 List constructor.
function DoValuate (valuator,...)
 Valuator function for functions that change the game state and as such are nore allowed as function for AIAbstarctList::Valuate.
function SetValueAsItem ()
 Set the value of all items to the item.
function ItemsToArray ()
 Get all of items as an array.
function ValuesToArray ()
 Get all of values as an array.
function AddItems (an_array)
 Add items of AIList from array All the new items are added with value 0.
function toarray ()
 Get all of data as an array with [item, value]-pairs.
function AddFromArray (an_array)
 Add all [item, value]-pairs from a given array to this list.
function SortItemAscending ()
 Sort by item, ascending.
function SortItemDescending ()
 Sort by item, descending.
function SortValueAscending ()
 Sort by value, ascending.
function SortValueDescending ()
 Sort by value, descending.
function AddTile (tile)
 Add a tile to the to-be-evaluated tiles.
function RemoveTile (tile)
 Remove a tile to the to-be-evaluated tiles.
function AddRectangle (tile_from, tile_to)
 Adds the rectangle between t1 and t2 to the list.
function RemoveRectangle (tile_from, tile_to)
 Remove the rectangle between t1 and t2 from the list.
function Peek ()
 Get the topmost item from the list.
function Pop ()
 Remove the topmost item from the list and return it.
function Push (idx)
 Add an item to the list.
function CountIfRemoveBetweenValue (start, end)
 Pre-count items left if Removes all items with a value above start and below end.
function CountIfRemoveAboveValue (val)
 Pre-count items left if Removes all items with a higher value than 'val'.
function CountIfRemoveBelowValue (val)
 Pre-count items left if Removes all items with a lower value than 'val'.
function CountIfRemoveValue (val)
 Pre-count items left if Remove all items with this value.
function CountIfKeepValue (val)
 Pre-count items left if Keep all items with this value.
function CountIfRemoveTop (n)
 Pre-count items left if Remove n items from top.
function CountIfRemoveBottom (n)
 Pre-count items left if Remove n items from bottom.

Detailed Description

Valuator libraries.

Constructor & Destructor Documentation

constructor List::List ( list  = null)
inline

List constructor.

Parameters
listoptional AIList to copy

Member Function Documentation

function List::AddFromArray ( an_array  )

Add all [item, value]-pairs from a given array to this list.

Parameters
an_arrayArray of same function returned by List::toarray()
function List::AddRectangle ( tile_from  ,
tile_to   
)

Adds the rectangle between t1 and t2 to the list.

Parameters
tile_fromOne corner of the tiles to add.
tile_toThe other corner of the tiles to add.
Precondition
AIMap::IsValidTile(tile_from).
AIMap::IsValidTile(tile_to).
function List::AddTile ( tile  )

Add a tile to the to-be-evaluated tiles.

Parameters
tileThe tile to add.
Precondition
AIMap::IsValidTile(tile).
function List::CountIfKeepValue ( val  )

Pre-count items left if Keep all items with this value.

Parameters
valthe value to keep.
Returns
count of left item.
function List::CountIfRemoveAboveValue ( val  )

Pre-count items left if Removes all items with a higher value than 'val'.

Parameters
valthe value above which all items are removed.
Returns
count of left item.
function List::CountIfRemoveBelowValue ( val  )

Pre-count items left if Removes all items with a lower value than 'val'.

Parameters
valthe value below which all items are removed.
Returns
count of left item.
function List::CountIfRemoveBetweenValue ( start  ,
end   
)

Pre-count items left if Removes all items with a value above start and below end.

Parameters
startthe lower bound of the to be removed values (exclusive).
endthe upper bound of the to be removed valuens (exclusive).
Returns
count of left item.
function List::CountIfRemoveBottom ( )

Pre-count items left if Remove n items from bottom.

Parameters
nthe number of item to remove from bottom.
Returns
count of left item.
function List::CountIfRemoveTop ( )

Pre-count items left if Remove n items from top.

Parameters
nthe number of item to remove from top.
Returns
count of left item.
function List::CountIfRemoveValue ( val  )

Pre-count items left if Remove all items with this value.

Parameters
valthe value to remove.
Returns
count of left item.
function List::DoValuate ( valuator  ,
  ... 
)

Valuator function for functions that change the game state and as such are nore allowed as function for AIAbstarctList::Valuate.

Parameters
valuatorFunction to be used as valuator
...Additional argument to be passed to the valuator
function List::ItemsToArray ( )

Get all of items as an array.

Returns
An array with all items in it.
function List::Peek ( )

Get the topmost item from the list.

Precondition
!IsEmpty()
Returns
the topmost item of the list
function List::Pop ( )

Remove the topmost item from the list and return it.

Precondition
!IsEmpty()
Returns
the topmost item of the list
function List::RemoveRectangle ( tile_from  ,
tile_to   
)

Remove the rectangle between t1 and t2 from the list.

Parameters
t1One corner of the tiles to remove.
t2The other corner of the tiles to remove.
function List::RemoveTile ( tile  )

Remove a tile to the to-be-evaluated tiles.

Parameters
tileThe tile to remove.
Precondition
AIMap::IsValidTile(tile).
function List::toarray ( )

Get all of data as an array with [item, value]-pairs.

Returns
An array with all data.
function List::ValuesToArray ( )

Get all of values as an array.

Returns
An array with all values in it.

The documentation for this class was generated from the following file: