git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1331 993157c7-ee19-0410-b2c4-bb4e9862e678
This commit is contained in:
(no author)
2007-07-23 16:03:09 +00:00
parent 74b4d5d455
commit ac87f06ef1
5 changed files with 23 additions and 19 deletions

View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenRa
{
// Put globally-useful delegate types here, particularly if
// they are generic.
public delegate T Provider<T>();
}

View File

@@ -34,6 +34,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Delegates.cs" />
<Compile Include="float2.cs" />
<Compile Include="int2.cs" />
<Compile Include="PriorityQueue.cs" />

View File

@@ -47,8 +47,7 @@ namespace OpenRa.Game
};
}
public delegate int IndexFetchFunc();
public void PlayFetchIndex( string sequenceName, IndexFetchFunc func )
public void PlayFetchIndex( string sequenceName, Provider<int> func )
{
tickAlways = true;
currentSequence = SequenceProvider.GetSequence( name, sequenceName );

View File

@@ -24,9 +24,9 @@ namespace OpenRa.Game
}
// returns estimate to destination, 0.0 is cell is dest
public delegate double DestinationFunc( int2 cell );
public delegate double DistanceHeuristic( int2 cell );
public List<int2> FindUnitPath( Unit unit, DestinationFunc estimator )
public List<int2> FindUnitPath( Unit unit, DistanceHeuristic estimator )
{
int2 startLocation = unit.Location + map.Offset;
@@ -39,7 +39,7 @@ namespace OpenRa.Game
return FindUnitPath( startLocation, estimator, map.Offset, cellInfo );
}
List<int2> FindUnitPath( int2 startLocation, DestinationFunc estimator, int2 offset, CellInfo[,] cellInfo )
List<int2> FindUnitPath( int2 startLocation, DistanceHeuristic estimator, int2 offset, CellInfo[,] cellInfo )
{
PriorityQueue<PathDistance> queue = new PriorityQueue<PathDistance>();
@@ -107,7 +107,7 @@ namespace OpenRa.Game
new int2( 1, 1 ),
};
public static DestinationFunc DefaultEstimator( int2 destination )
public static DistanceHeuristic DefaultEstimator( int2 destination )
{
return delegate( int2 here )
{

View File

@@ -14,11 +14,9 @@ OpenRA
[ ] Infantry
[ ] Infantry squishing logic (tracked vehicles do this)
[ ] pathing
[ ] Pathing
[ ] Group pathfinding logic
[ ] Special-case pathing for floating units...
Does existing pathing work for boats? float=?? speeds should tell us everything required..
- No pathing for air, just fly towards a spot
[ ] Make units have a movement type, for pathing. Boats Just Work, if we do this.
[ ] Solid buildings, units
[ ] Rendering
@@ -33,7 +31,7 @@ OpenRA
[ ] Configuration option for choosing which tuned solution to use:
- Cope with lack of HW VP
- Cope with lack of fast texture memory (although UMA makes this almost a non-issue)
- Cope with REALLY WINFUL FAST HEAVENLY HARDWARE (The boss might want to play this :P )
[ ] Palette hax for selection outlines. Basically, just hijack a palette entry that's not
getting used, and draw the selection borders into the SHP images using that color.
Then we double up the hardware palettes, and we can draw selection with no extra cost.
@@ -50,18 +48,13 @@ OpenRA
[ ] Read/write distinction on IFolder implementors. I think Package should be read-only,
FS folders can be mounted read-only or read-write, (or even write-only, but that's odd...)
Use FileSystem.Create() to automatically place output files on sensible mounts.
[ ] Fix weird delegate names - Provider<T>, Comparison<T>, Converter<T>, Action<T>
should be used where appropriate. `Func` says nothing, and is damned misleading
when the delegate isnt referentially transparent... IE, not a `function`.
Note that the lack of referential transparency for Provider<T> cannot be helped,
it's in the nature of an object that converts () -> T.
[ ] Ditch special unit classes, use templates extracted from rules.ini instead.
Push the special-case logic into code that can be named.
[ ] Remove all remaining `../../../` bullshit from the code. We should be able to set our datapaths
externally, then `just go`. The FileSystem class is there to facilitate this.
[ ] Factor duplication out of Sheet, HardwarePalette. Both contain logic for converting bitmaps to
hardware textures on demand.
[ ] Get rid of all the damned static classes! Makes it REALLY HARD to reuse code,
dependencies aren't easily visible (or even substitutable, which matters more)