Skip to content

Commit 43754bd

Browse files
Redback93Redback93
authored andcommitted
Initial commit
0 parents  commit 43754bd

File tree

11 files changed

+451
-0
lines changed

11 files changed

+451
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
_ReSharper.osu!api/
2+
osu!api.v11.suo

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
osu-api
2+
=======
3+
4+
A C# implementation of the osu!api
5+
6+
###Example of usage:
7+
8+
```
9+
var api = new osuAPI("Your API Key");
10+
var redback = api.GetUser("Redback", Mode.osu);
11+
Console.WriteLine(redback.count_rank_ss);
12+
```

osu!api.sln

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 2012
4+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu!api", "osu!api\osu!api.csproj", "{15695389-0211-42B9-A7AD-7FF6E49845A0}"
5+
EndProject
6+
Global
7+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8+
Debug|Any CPU = Debug|Any CPU
9+
Release|Any CPU = Release|Any CPU
10+
EndGlobalSection
11+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
12+
{15695389-0211-42B9-A7AD-7FF6E49845A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13+
{15695389-0211-42B9-A7AD-7FF6E49845A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
14+
{15695389-0211-42B9-A7AD-7FF6E49845A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
15+
{15695389-0211-42B9-A7AD-7FF6E49845A0}.Release|Any CPU.Build.0 = Release|Any CPU
16+
EndGlobalSection
17+
GlobalSection(SolutionProperties) = preSolution
18+
HideSolutionNode = FALSE
19+
EndGlobalSection
20+
EndGlobal

osu!api/Beatmap.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System;
2+
3+
namespace osu_api
4+
{
5+
public class Beatmap
6+
{
7+
public string approved { get; set; }
8+
public DateTime approved_date { get; set; }
9+
public DateTime last_update { get; set; }
10+
public string artist { get; set; }
11+
public int beatmap_id { get; set; }
12+
public int beatmapset_id { get; set; }
13+
public int bpm { get; set; }
14+
public string creator { get; set; }
15+
public double difficultyrating { get; set; }
16+
public int diff_size { get; set; }
17+
public int diff_overall { get; set; }
18+
public int diff_approach { get; set; }
19+
public int diff_drain { get; set; }
20+
public int hit_length { get; set; }
21+
public string source { get; set; }
22+
public string title { get; set; }
23+
public int total_length { get; set; }
24+
public string version { get; set; }
25+
public int mode { get; set; }
26+
}
27+
}

osu!api/Event.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System;
2+
3+
namespace osu_api
4+
{
5+
public class Event
6+
{
7+
public string display_html { get; set; }
8+
public int beatmap_id { get; set; }
9+
public int beatmapset_id { get; set; }
10+
public DateTime date { get; set; }
11+
public int epicfactor { get; set; }
12+
}
13+
}

osu!api/MultiplayerMatch.cs

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace osu_api
8+
{
9+
public class MultiplayerMatch
10+
{
11+
public Match match { get; set; }
12+
public Game[] games { get; set; }
13+
}
14+
15+
public class Match
16+
{
17+
public int match_id { get; set; }
18+
public string name { get; set; }
19+
public DateTime start_time { get; set; }
20+
public DateTime? end_time { get; set; }
21+
}
22+
23+
public class Game
24+
{
25+
public int game_id { get; set; }
26+
public DateTime start_time { get; set; }
27+
public DateTime? end_time { get; set; }
28+
public int beatmap_id { get; set; }
29+
public Mode play_mode { get; set; }
30+
public int match_type { get; set; }
31+
public ScoringType scoring_type { get; set; }
32+
public TeamType team_type { get; set; }
33+
public int mods { get; set; }
34+
public Score[] scores { get; set; }
35+
}
36+
37+
public class MatchScore : Score
38+
{
39+
public int slot { get; set; }
40+
public int team { get; set; }
41+
public int pass { get; set; }
42+
}
43+
44+
public enum ScoringType
45+
{
46+
Score = 0,
47+
Accuracy = 1,
48+
Combo = 2
49+
}
50+
51+
public enum TeamType
52+
{
53+
HeadToHead = 0,
54+
TagCoOp = 1,
55+
TeamVs = 2,
56+
TagTeamVs = 3
57+
}
58+
}

osu!api/Properties/AssemblyInfo.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("osu!api")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("osu!api")]
13+
[assembly: AssemblyCopyright("Copyright © 2014")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("3cf08d49-2b19-4d3b-b2f1-0fea40160168")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

osu!api/Score.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System;
2+
3+
namespace osu_api
4+
{
5+
public class Score
6+
{
7+
public int score { get; set; }
8+
public string username { get; set; }
9+
public int count300 { get; set; }
10+
public int count100 { get; set; }
11+
public int count50 { get; set; }
12+
public int countmiss { get; set; }
13+
public int maxcombo { get; set; }
14+
public int countkatu { get; set; }
15+
public int countgeki { get; set; }
16+
public int perfect { get; set; }
17+
public int enabled_mods { get; set; }
18+
public int user_id { get; set; }
19+
public DateTime date { get; set; }
20+
public string rank { get; set; }
21+
public double pp { get; set; }
22+
}
23+
}

osu!api/User.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
namespace osu_api
2+
{
3+
public class User
4+
{
5+
public int user_id { get; set; }
6+
public string username { get; set; }
7+
public int count300 { get; set; }
8+
public int count100 { get; set; }
9+
public int count50 { get; set; }
10+
public int playcount { get; set; }
11+
public long ranked_score { get; set; }
12+
public long total_score { get; set; }
13+
public int pp_rank { get; set; }
14+
public double level { get; set; }
15+
public double pp_raw { get; set; }
16+
public double accuracy { get; set; }
17+
public int count_rank_ss { get; set; }
18+
public int count_rank_s { get; set; }
19+
public int count_rank_a { get; set; }
20+
public string country { get; set; }
21+
public Event[] events { get; set; }
22+
}
23+
}

osu!api/osu!api.csproj

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{15695389-0211-42B9-A7AD-7FF6E49845A0}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>osu_api</RootNamespace>
11+
<AssemblyName>osu!api</AssemblyName>
12+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<DebugSymbols>true</DebugSymbols>
17+
<DebugType>full</DebugType>
18+
<Optimize>false</Optimize>
19+
<OutputPath>bin\Debug\</OutputPath>
20+
<DefineConstants>DEBUG;TRACE</DefineConstants>
21+
<ErrorReport>prompt</ErrorReport>
22+
<WarningLevel>4</WarningLevel>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25+
<DebugType>pdbonly</DebugType>
26+
<Optimize>true</Optimize>
27+
<OutputPath>bin\Release\</OutputPath>
28+
<DefineConstants>TRACE</DefineConstants>
29+
<ErrorReport>prompt</ErrorReport>
30+
<WarningLevel>4</WarningLevel>
31+
</PropertyGroup>
32+
<ItemGroup>
33+
<Reference Include="Newtonsoft.Json">
34+
<HintPath>..\..\MSAWPCL\MSAWPCL\Newtonsoft.Json.dll</HintPath>
35+
</Reference>
36+
<Reference Include="System" />
37+
<Reference Include="System.Core" />
38+
<Reference Include="System.Xml.Linq" />
39+
<Reference Include="System.Data.DataSetExtensions" />
40+
<Reference Include="Microsoft.CSharp" />
41+
<Reference Include="System.Data" />
42+
<Reference Include="System.Xml" />
43+
</ItemGroup>
44+
<ItemGroup>
45+
<Compile Include="Beatmap.cs" />
46+
<Compile Include="MultiplayerMatch.cs" />
47+
<Compile Include="Score.cs" />
48+
<Compile Include="Event.cs" />
49+
<Compile Include="osuAPI.cs" />
50+
<Compile Include="Properties\AssemblyInfo.cs" />
51+
<Compile Include="User.cs" />
52+
</ItemGroup>
53+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
54+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
55+
Other similar extension points exist, see Microsoft.Common.targets.
56+
<Target Name="BeforeBuild">
57+
</Target>
58+
<Target Name="AfterBuild">
59+
</Target>
60+
-->
61+
</Project>

0 commit comments

Comments
 (0)