-
Notifications
You must be signed in to change notification settings - Fork 36
Getting Started
GoRogue is a .NET Standard library, and as such, can be used with any .NET projects running on a platform that supports .NET Standard 2.0. Compatible platforms include, but are not limited to, .NET Framework 4.6.1 or higher, Mono 5.4 or higher, and .NET Core 2.0 or higher. Additional compatibility information for .NET Standard 2.0 can be found at Microsoft's site here.
The library is distributed as a NuGet package, so installation is exactly like that of any other NuGet package. Instructions below outline the process for popular platforms.
On Windows, setup is easiest using Visual Studio Community 2017, which can be downloaded for free here. With Visual Studio installed, perform the following steps:
- Open Visual Studio, and select File->New->Project.... From templates, choose Visual C#->Console App (.NET Framework). Note that any other .NET Framework project type should also suffice.
- Give the project any name and location you want. Although it is not required, demonstration projects on this Wiki also ensure Create Directory For Solution is unchecked, as it will simplify the resulting file structure for single-project solutions (causing the project file to reside in the same location as the solution file, rather than a subdirectory). Click OK.
- Next, we must add the NuGet package. Right click on the project in the Solution explorer, and choose Manage NuGet Packages.
- Ensure that the Browse tab is selected, and that Package Source is set to nuget.org, then search GoRogue. Install the package.
- Replace the Main function in Program.cs with the following:
static void Main(string[] args)
{
System.Console.WriteLine(GoRogue.Coord.Get(1, 2));
// Used to stop window from closing until a key is pressed.
int c = System.Console.Read();
}- Run the project and you should see the coordinate printed out.
Setting up GoRogue in a .NET Core project is virtually identical to the .NET Framework instructions above, and also easiest using Visual Studio Community 2017, which can be downloaded for free here. With Visual Studio installed, perform the following steps:
- Open Visual Studio, and select File->New->Project.... From templates, choose Visual C#->Console App (.NET Core). Note that any other .NET Core project type should also suffice.
- Give the project any name and location you want. Although it is not required, demonstration projects on this Wiki also ensure Create Directory For Solution is unchecked, as it will simplify the resulting file structure for single-project solutions (causing the project file to reside in the same location as the solution file, rather than a subdirectory). Click OK.
- Next, we must add the NuGet package. Right click on the project in the Solution explorer, and choose Manage NuGet Packages.
- Ensure that the Browse tab is selected, and that Package Source is set to nuget.org, then search GoRogue. Install the package.
- Replace the Main function in Program.cs with the following:
static void Main(string[] args)
{
System.Console.WriteLine(GoRogue.Coord.Get(1, 2));
// Used to stop window from closing until a key is pressed.
int c = System.Console.Read();
}- Run the project and you should see the coordinate printed out.
On Linux distributions, a .NET Framework project can be compiled using Mono, and is easiest created with MonoDevelop. The newest mainstream version of MonoDevelop (7.3 at the time of this writing) has a Mono installation packaged with it, and can be installed using flatpak. See this link for the MonoDevelop flatpak file, and this link for details on flatpak usage, or follow the steps below.
- Visit the MonoDevelop downloads page, and download the newest MonoDevelop.flatpakref file.
- In terminal, from the directory in which the MonoDevelop.flatpakref file is located, run
flatpak install MonoDevelop.flatpakrefto begin the install. - Run the command
flatpak run com.xamarin.MonoDevelop. This will run MonoDevelop for the first time, and ensure a shortcut is placed in your programs menu.
Once MonoDevelop is installed, perform the following steps:
- Open MonoDevelop, and select File->New Solution.... From templates, choose .NET->Console Project (C#). Note that any other .NET Framework project type should also suffice. Then, select next.
-
Give the project any name and location you want. Although it is not required, demonstration projects on this Wiki also ensure Create a project directory within the solution directory is unchecked, as it will simplify the resulting file structure for single-project solutions (causing the project file to reside in the same location as the solution file, rather than a subdirectory). Click Create.
-
Next, we must add the NuGet package. In the Solution view, under the project dropdown, right-click on Packages, and choose Add Packages....
- Ensure that the Package Source dropdown is set to nuget.org, then search GoRogue. Install the package.
- Replace the Main function in Program.cs with the following:
static void Main(string[] args)
{
System.Console.WriteLine(GoRogue.Coord.Get(1, 2));
// Used to stop window from closing until a key is pressed.
int c = System.Console.Read();
}- Run the project and you should see the coordinate printed out.
On Linux distributions, a .NET Core project requires an installation of the .NET Core SDK. The download and installation instructions can easily be found for various distributions here. NOTE: The version the commands install by default may not be the most recent. Feel free to install the most recent version, however any version 2.0 or greater should work fine.
- In terminal, in the directory you want to create the project, run the following commands:
dotnet new console -o TestProjGoRogue
cd TestProjGoRogueThis creates a new console project called TestProjGoRogue, and changes to its directory. Note that although console is used here, any other .NET Core project type should work fine.
-
Now we must add the NuGet package. Run the command
dotnet package add GoRogue. -
Replace the Main function in Program.cs with the following:
static void Main(string[] args)
{
System.Console.WriteLine(GoRogue.Coord.Get(1, 2));
// Used to stop window from closing until a key is pressed.
int c = System.Console.Read();
}- Run the project with
dotnet run. You should see the coordinate printed out.
On MacOS, the newest version of Visual Studio for Mac has proper versions of Mono and .NET Core packaged with it, and can be used to create both project templates (with or without the XCode portion).
Once Visual Studio is installed, perform the following steps:
- Open Visual Studio, and select File->New Solution.... From templates, choose .NET->Console Project (C#). Note that any other .NET Framework project type should also suffice. Then, select next.
- Give the project any name and location you want. Although it is not required, demonstration projects on this Wiki also ensure Create a project directory within the solution directory is unchecked, as it will simplify the resulting file structure for single-project solutions (causing the project file to reside in the same location as the solution file, rather than a subdirectory). Click Create.
- Next, we must add the NuGet package. In the Solution view, under the project dropdown, right-click on Packages, and choose Add Packages....
- Ensure that the Package Source dropdown is set to nuget.org, then search GoRogue. Install the package.
- Replace the Main function in Program.cs with the following:
static void Main(string[] args)
{
System.Console.WriteLine(GoRogue.Coord.Get(1, 2));
// Used to stop window from closing until a key is pressed.
int c = System.Console.Read();
}- Run the project and you should see the coordinate printed out.
Setting up GoRogue in a .NET Core project is virtually identical to the .NET Framework instructions above, and also easiest using Visual Studio for Mac. With Visual Studio installed, perform the following steps:
- Open Visual Studio, and select File->New Solution.... From templates, choose .NET Core->App->Console Project (C#). Note that any other .NET Core project type should also suffice. Then, select next.
- Give the project any name and location you want. Although it is not required, demonstration projects on this Wiki also ensure Create a project directory within the solution directory is unchecked, as it will simplify the resulting file structure for single-project solutions (causing the project file to reside in the same location as the solution file, rather than a subdirectory). Click Create.
- Next, we must add the NuGet package. In the Solution view, under the project dropdown, right-click on Dependencies, and choose Add Packages....
- Ensure that the Package Source dropdown is set to nuget.org, then search GoRogue. Install the package.
- Replace the Main function in Program.cs with the following:
static void Main(string[] args)
{
System.Console.WriteLine(GoRogue.Coord.Get(1, 2));
// Used to stop window from closing until a key is pressed.
int c = System.Console.Read();
}- Run the project and you should see the coordinate printed out.
- Home
- Getting Started
- GoRogue 1.0 to 2.0 Upgrade Guide
- Grid System
- Dice Rolling
- Effects System
- Field of View
- Map Generation (docs coming soon)
- Map View System
- Pathfinding (docs coming soon)
- Random Number Generation (docs coming soon)
- Sense Mapping (docs coming soon)
- Spatial Maps (docs coming soon)
- Utility/Miscellaneous (docs coming soon)