Skip to content

Commit b289a26

Browse files
committed
Added a support for Ownership, Visibility, and "Destroyedness".
Regenerated API DLL with collapsed property accessors. Finished documentation of all robot API public classes. Fixed Doxygen which broke because one property could not be accessed. Added a new Doxyfile for developer API and disabled absolute file paths. Default ExceptionOnDeadUnitAction set to false; throws on queue assign. Improved internal queue algorithm to stop processing for dead units. Fixed issue with Fog LocationsSeenTemporary index not being initialized. Fixed rare hazard issue with AStar calculating for an already dead unit. Reduced the camera speed when in lag by discarding Time delta, better UX.
1 parent 206e611 commit b289a26

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2184
-139
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ sysinfo.txt
4646

4747
# Doxygen Documentation
4848
/[Dd]ocs/*
49-
!/[Dd]ocs/[Dd]oxyfile
49+
!/[Dd]ocs/[Dd]oxyfile*

API/Sources/Actors/Actor.cs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
using System;
1+
using XposeCraft.Game.Enums;
22

33
namespace XposeCraft.Game.Actors
44
{
5-
/// <summary>
6-
/// Representation of a Game Actor in Unity.
7-
/// </summary>
5+
/// <inheritdoc cref="IActor"/>
86
public abstract class Actor : IActor
97
{
10-
/// <summary>
11-
/// Current Position of the Actor.
12-
/// </summary>
13-
public Position Position
14-
{
15-
get { throw new NotImplementedException(); }
16-
}
8+
public Position Position { get; }
9+
10+
public OwnershipType Ownership { get; }
11+
12+
public bool Visible { get; }
1713
}
1814
}
Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
using System;
22
using System.Collections.Generic;
3+
using XposeCraft.Game.Actors.Resources;
4+
using XposeCraft.Game.Actors.Units;
35
using XposeCraft.Game.Enums;
46

57
namespace XposeCraft.Game.Actors.Buildings
68
{
79
/// <summary>
8-
/// A base building that creates new Workers and receives collected Resources.
10+
/// A base building that creates new <see cref="Worker"/>s and receives collected <see cref="IResource"/>s.
911
/// </summary>
1012
public class BaseCenter : Building, IUnitProduction
1113
{
12-
public Position SpawnPosition
13-
{
14-
get { throw new NotImplementedException(); }
15-
}
14+
public Position SpawnPosition { get; }
1615

17-
public List<UnitType> SupportsUnitProduction
18-
{
19-
get { throw new NotImplementedException(); }
20-
}
16+
public List<UnitType> SupportsUnitProduction { get; }
2117

2218
public bool CanNowProduceUnit(UnitType unitType)
2319
{
@@ -29,14 +25,8 @@ public void ProduceUnit(UnitType unitType)
2925
throw new NotImplementedException();
3026
}
3127

32-
public int QueuedUnits
33-
{
34-
get { throw new NotImplementedException(); }
35-
}
28+
public int QueuedUnits { get; }
3629

37-
public int QueueLimit
38-
{
39-
get { throw new NotImplementedException(); }
40-
}
30+
public int QueueLimit { get; }
4131
}
4232
}
Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
using System;
2-
31
namespace XposeCraft.Game.Actors.Buildings
42
{
3+
/// <inheritdoc cref="IBuilding"/>
54
public abstract class Building : Actor, IBuilding
65
{
7-
public bool Finished
8-
{
9-
get { throw new NotImplementedException(); }
10-
}
6+
public bool Finished { get; }
7+
8+
public float ConstructionProgress { get; }
119

12-
public float ConstructionProgress
13-
{
14-
get { throw new NotImplementedException(); }
15-
}
10+
public bool Destroyed { get; }
1611
}
1712
}

API/Sources/Actors/Buildings/IBuilding.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
namespace XposeCraft.Game.Actors.Buildings
22
{
3+
/// <summary>
4+
/// Building placed in the game.
5+
/// </summary>
36
public interface IBuilding : IActor
47
{
58
/// <summary>
@@ -11,5 +14,10 @@ public interface IBuilding : IActor
1114
/// Percentage progress of the Building construction with values between 0 and 1.
1215
/// </summary>
1316
float ConstructionProgress { get; }
17+
18+
/// <summary>
19+
/// True if the Building has been already destroyed and cannot be ever used again.
20+
/// </summary>
21+
bool Destroyed { get; }
1422
}
1523
}

API/Sources/Actors/Buildings/IUnitProduction.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,14 @@ public interface IUnitProduction
3030
/// <exception cref="NotEnoughResourcesException">Not enough resources to enqueue the production.</exception>
3131
void ProduceUnit(UnitType unitType);
3232

33+
/// <summary>
34+
/// Number of currently queued Units that will be produced.
35+
/// </summary>
3336
int QueuedUnits { get; }
3437

38+
/// <summary>
39+
/// Maximum number of Units that can be queued at once to be produced.
40+
/// </summary>
3541
int QueueLimit { get; }
3642
}
3743
}
Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
using System;
22
using System.Collections.Generic;
3+
using XposeCraft.Game.Actors.Units;
34
using XposeCraft.Game.Enums;
45

56
namespace XposeCraft.Game.Actors.Buildings
67
{
8+
/// <summary>
9+
/// <see cref="DonkeyGun"/> production Building, a first available figher factory.
10+
/// </summary>
711
public class NubianArmory : Building, IUnitProduction
812
{
9-
public List<UnitType> SupportsUnitProduction
10-
{
11-
get { throw new NotImplementedException(); }
12-
}
13+
public List<UnitType> SupportsUnitProduction { get; }
1314

1415
public bool CanNowProduceUnit(UnitType unitType)
1516
{
@@ -21,14 +22,8 @@ public void ProduceUnit(UnitType unitType)
2122
throw new NotImplementedException();
2223
}
2324

24-
public int QueuedUnits
25-
{
26-
get { throw new NotImplementedException(); }
27-
}
25+
public int QueuedUnits { get; }
2826

29-
public int QueueLimit
30-
{
31-
get { throw new NotImplementedException(); }
32-
}
27+
public int QueueLimit { get; }
3328
}
3429
}

API/Sources/Actors/IActor.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
1+
using XposeCraft.Game.Enums;
2+
13
namespace XposeCraft.Game.Actors
24
{
5+
/// <summary>
6+
/// Representation of a Game Actor in Unity.
7+
/// </summary>
38
public interface IActor
49
{
510
/// <summary>
611
/// Current position of the Actor.
712
/// </summary>
813
Position Position { get; }
14+
15+
/// <summary>
16+
/// Checks who owns the Actor. In case of the Owner all actions are available and it is always Visible.
17+
/// </summary>
18+
OwnershipType Ownership { get; }
19+
20+
/// <summary>
21+
/// True if the Player can see the Actor, so it is not hidden in the Fog. Owned Actors are always visible.
22+
/// </summary>
23+
bool Visible { get; }
924
}
1025
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
using XposeCraft.Game.Actors.Units;
2+
13
namespace XposeCraft.Game.Actors.Resources
24
{
5+
/// <summary>
6+
/// Resource placed in the game. Can be collected by <see cref="Worker"/>.
7+
/// </summary>
38
public interface IResource : IActor
49
{
10+
/// <summary>
11+
/// True if the Resource has been already exhausted and can never be used again.
12+
/// </summary>
13+
bool Exhausted { get; }
514
}
615
}

API/Sources/Actors/Resources/Minerals/Mineral.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
using XposeCraft.Game.Actors.Buildings;
2+
using XposeCraft.Game.Actors.Units;
3+
14
namespace XposeCraft.Game.Actors.Resources.Minerals
25
{
6+
/// <summary>
7+
/// Main <see cref="IResource"/> used to build <see cref="IBuilding"/> or produce <see cref="IUnit"/>.
8+
/// </summary>
39
public class Mineral : Resource
410
{
511
}

0 commit comments

Comments
 (0)