Skip to content

Commit

Permalink
Public Release
Browse files Browse the repository at this point in the history
Version 1.0.1
  • Loading branch information
antonpup committed Feb 2, 2016
1 parent c9ad53e commit 80484f6
Show file tree
Hide file tree
Showing 20 changed files with 1,162 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,5 @@ _Pvt_Extensions

# FAKE - F# Make
.fake/
*.nuspec
Dota2GSI/nuget.exe
22 changes: 22 additions & 0 deletions Dota2GSI/Dota2GSI.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2013 for Windows Desktop
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dota2GSI", "Dota2GSI\Dota2GSI.csproj", "{ED6F76C6-A3FC-40F2-9B9B-3C47093A4B6F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{ED6F76C6-A3FC-40F2-9B9B-3C47093A4B6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ED6F76C6-A3FC-40F2-9B9B-3C47093A4B6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ED6F76C6-A3FC-40F2-9B9B-3C47093A4B6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ED6F76C6-A3FC-40F2-9B9B-3C47093A4B6F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
72 changes: 72 additions & 0 deletions Dota2GSI/Dota2GSI/Dota2GSI.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{ED6F76C6-A3FC-40F2-9B9B-3C47093A4B6F}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Dota2GSI</RootNamespace>
<AssemblyName>Dota2GSI</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</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>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="GameState.cs" />
<Compile Include="GameStateListener.cs" />
<Compile Include="Nodes\Abilities.cs" />
<Compile Include="Nodes\Ability.cs" />
<Compile Include="Nodes\Attributes.cs" />
<Compile Include="Nodes\Auth.cs" />
<Compile Include="Nodes\Hero.cs" />
<Compile Include="Nodes\Item.cs" />
<Compile Include="Nodes\Items.cs" />
<Compile Include="Nodes\Map.cs" />
<Compile Include="Nodes\Node.cs" />
<Compile Include="Nodes\Player.cs" />
<Compile Include="Nodes\Provider.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
150 changes: 150 additions & 0 deletions Dota2GSI/Dota2GSI/GameState.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
using System;
using Dota2GSI.Nodes;

namespace Dota2GSI
{
public class GameState
{
private Newtonsoft.Json.Linq.JObject _ParsedData;
private string json;

private Auth auth;
private Provider provider;
private Map map;
private Player player;
private Hero hero;
private Abilities abilities;
private Items items;
private GameState previously;
private GameState added;

/// <summary>
/// Initialises a new GameState object from JSON Data
/// </summary>
/// <param name="json_data"></param>
public GameState(string json_data)
{
if (json_data.Equals(""))
{
json_data = "{}";
}

json = json_data;
_ParsedData = Newtonsoft.Json.Linq.JObject.Parse(json_data);
}

public Auth Auth
{
get
{
if (auth == null)
auth = new Auth(GetNode("auth"));

return auth;
}
}

public Provider Provider
{
get
{
if (provider == null)
provider = new Provider(GetNode("provider"));

return provider;
}
}

public Map Map
{
get
{
if (map == null)
map = new Map(GetNode("map"));

return map;
}
}

public Player Player
{
get
{
if (player == null)
player = new Player(GetNode("player"));

return player;
}
}

public Hero Hero
{
get
{
if (hero == null)
hero = new Hero(GetNode("hero"));

return hero;
}
}

public Abilities Abilities
{
get
{
if (abilities == null)
abilities = new Abilities(GetNode("abilities"));

return abilities;
}
}

public Items Items
{
get
{
if (items == null)
items = new Items(GetNode("items"));

return items;
}
}

public GameState Previously
{
get
{
if (previously == null)
previously = new GameState(GetNode("previously"));

return previously;
}
}

public GameState Added
{
get
{
if (added == null)
added = new GameState(GetNode("added"));

return added;
}
}

private String GetNode(string name)
{
Newtonsoft.Json.Linq.JToken value;

if (_ParsedData.TryGetValue(name, out value))
return value.ToString();
else
return "";
}

public override string ToString()
{
return json;
}
}
}
Loading

0 comments on commit 80484f6

Please sign in to comment.