Skip to content

Commit

Permalink
Added documentation, Updated packages
Browse files Browse the repository at this point in the history
Documentation is taken from my other project, Aurora.
https://github.com/antonpup/Aurora
  • Loading branch information
antonpup committed Sep 18, 2016
1 parent 5e36236 commit d1ee372
Show file tree
Hide file tree
Showing 14 changed files with 432 additions and 43 deletions.
7 changes: 4 additions & 3 deletions Dota2GSI/Dota2GSI/Dota2GSI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Dota2GSI.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
31 changes: 29 additions & 2 deletions Dota2GSI/Dota2GSI/GameState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

namespace Dota2GSI
{
/// <summary>
/// A class representing various information retaining to Game State Integration of Dota 2
/// </summary>
public class GameState
{
private Newtonsoft.Json.Linq.JObject _ParsedData;
Expand All @@ -19,9 +22,9 @@ public class GameState
private GameState added;

/// <summary>
/// Initialises a new GameState object from JSON Data
/// Creates a GameState instance based on the passed json data.
/// </summary>
/// <param name="json_data"></param>
/// <param name="json_data">The passed json data</param>
public GameState(string json_data)
{
if (json_data.Equals(""))
Expand All @@ -33,6 +36,9 @@ public GameState(string json_data)
_ParsedData = Newtonsoft.Json.Linq.JObject.Parse(json_data);
}

/// <summary>
/// Information about GSI authentication
/// </summary>
public Auth Auth
{
get
Expand All @@ -44,6 +50,9 @@ public Auth Auth
}
}

/// <summary>
/// Information about the provider of this GameState
/// </summary>
public Provider Provider
{
get
Expand All @@ -55,6 +64,9 @@ public Provider Provider
}
}

/// <summary>
/// Information about the current map
/// </summary>
public Map Map
{
get
Expand All @@ -66,6 +78,9 @@ public Map Map
}
}

/// <summary>
/// Information about the local player
/// </summary>
public Player Player
{
get
Expand All @@ -77,6 +92,9 @@ public Player Player
}
}

/// <summary>
/// Information about the local player's hero
/// </summary>
public Hero Hero
{
get
Expand All @@ -88,6 +106,9 @@ public Hero Hero
}
}

/// <summary>
/// Information about the local player's hero abilities
/// </summary>
public Abilities Abilities
{
get
Expand All @@ -99,6 +120,9 @@ public Abilities Abilities
}
}

/// <summary>
/// Information about the local player's hero items
/// </summary>
public Items Items
{
get
Expand All @@ -110,6 +134,9 @@ public Items Items
}
}

/// <summary>
/// A previous GameState
/// </summary>
public GameState Previously
{
get
Expand Down
4 changes: 0 additions & 4 deletions Dota2GSI/Dota2GSI/GameStateListener.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;

namespace Dota2GSI
{
Expand Down
23 changes: 16 additions & 7 deletions Dota2GSI/Dota2GSI/Nodes/Abilities.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
using System;
using System.Collections;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace Dota2GSI.Nodes
{
/// <summary>
/// Class representing hero abilities
/// </summary>
public class Abilities : Node, IEnumerable<Ability>
{
private List<Ability> abilities = new List<Ability>();

/// <summary>
/// The attributes a hero has to spend on abilities
/// </summary>
public readonly Attributes Attributes;

private string json;

/// <summary>
/// The number of abilities
/// </summary>
public int Count { get { return abilities.Count; } }

internal Abilities(string json_data) : base(json_data)
Expand All @@ -29,9 +38,9 @@ internal Abilities(string json_data) : base(json_data)
}

/// <summary>
/// Gets the ability in the selected index
/// Gets the ability at a specified index
/// </summary>
/// <param name="index"></param>
/// <param name="index">The index</param>
/// <returns></returns>
public Ability this[int index]
{
Expand All @@ -46,19 +55,19 @@ public Ability this[int index]

public IEnumerator<Ability> GetEnumerator()
{
return this.abilities.GetEnumerator();
return abilities.GetEnumerator();
}

IEnumerator IEnumerable.GetEnumerator()
{
return this.abilities.GetEnumerator();
return abilities.GetEnumerator();
}

public override string ToString()
{
return json;
}


}
}
30 changes: 30 additions & 0 deletions Dota2GSI/Dota2GSI/Nodes/Ability.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,43 @@
namespace Dota2GSI.Nodes
{
/// <summary>
/// Class representing ability information
/// </summary>
public class Ability : Node
{
/// <summary>
/// Ability name
/// </summary>
public readonly string Name;

/// <summary>
/// Ability level
/// </summary>
public readonly int Level;

/// <summary>
/// A boolean representing whether the ability can be casted
/// </summary>
public readonly bool CanCast;

/// <summary>
/// A boolean representing whether the ability is passive
/// </summary>
public readonly bool IsPassive;

/// <summary>
/// A boolean representing whether the ability is active
/// </summary>
public readonly bool IsActive;

/// <summary>
/// Ability cooldown
/// </summary>
public readonly int Cooldown;

/// <summary>
/// A boolean representing whether the ability is an ultimate
/// </summary>
public readonly bool IsUltimate;

internal Ability(string json_data) : base(json_data)
Expand Down
6 changes: 6 additions & 0 deletions Dota2GSI/Dota2GSI/Nodes/Attributes.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
namespace Dota2GSI.Nodes
{
/// <summary>
/// Class representing ability attributes
/// </summary>
public class Attributes : Node
{
/// <summary>
/// Amount of levels to spend
/// </summary>
public readonly int Level;

internal Attributes(string json_data) : base(json_data)
Expand Down
3 changes: 3 additions & 0 deletions Dota2GSI/Dota2GSI/Nodes/Auth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
{
public class Auth : Node
{
/// <summary>
/// The auth token sent by this GSI
/// </summary>
public readonly string Token;

internal Auth(string json_data) : base(json_data)
Expand Down
86 changes: 86 additions & 0 deletions Dota2GSI/Dota2GSI/Nodes/Hero.cs
Original file line number Diff line number Diff line change
@@ -1,27 +1,113 @@
namespace Dota2GSI.Nodes
{
/// <summary>
/// Class representing hero information
/// </summary>
public class Hero : Node
{
/// <summary>
/// Hero ID
/// </summary>
public readonly int ID;

/// <summary>
/// Hero name
/// </summary>
public readonly string Name;

/// <summary>
/// Hero level
/// </summary>
public readonly int Level;

/// <summary>
/// A boolean representing whether the hero is alive
/// </summary>
public readonly bool IsAlive;

/// <summary>
/// Amount of seconds until the hero respawns
/// </summary>
public readonly int SecondsToRespawn;

/// <summary>
/// The buyback cost
/// </summary>
public readonly int BuybackCost;

/// <summary>
/// The buyback cooldown
/// </summary>
public readonly int BuybackCooldown;

/// <summary>
/// Hero health
/// </summary>
public readonly int Health;

/// <summary>
/// Hero max health
/// </summary>
public readonly int MaxHealth;

/// <summary>
/// Hero health percentage
/// </summary>
public readonly int HealthPercent;

/// <summary>
/// Hero mana
/// </summary>
public readonly int Mana;

/// <summary>
/// Hero max mana
/// </summary>
public readonly int MaxMana;

/// <summary>
/// Hero mana percent
/// </summary>
public readonly int ManaPercent;

/// <summary>
/// A boolean representing whether the hero is silenced
/// </summary>
public readonly bool IsSilenced;

/// <summary>
/// A boolean representing whether the hero is stunned
/// </summary>
public readonly bool IsStunned;

/// <summary>
/// A boolean representing whether the hero is disarmed
/// </summary>
public readonly bool IsDisarmed;

/// <summary>
/// A boolean representing whether the hero is magic immune
/// </summary>
public readonly bool IsMagicImmune;

/// <summary>
/// A boolean representing whether the hero is hexed
/// </summary>
public readonly bool IsHexed;

/// <summary>
/// A boolean representing whether the hero is muteds
/// </summary>
public readonly bool IsMuted;

/// <summary>
/// A boolean representing whether the hero is broken
/// </summary>
public readonly bool IsBreak;

/// <summary>
/// A boolean representing whether the hero is debuffed
/// </summary>
public readonly bool HasDebuff;

internal Hero(string json_data) : base(json_data)
Expand Down
Loading

0 comments on commit d1ee372

Please sign in to comment.