Jump to content
  • Advertisement

Search the Community

Showing results for tags 'Visual Studio'.

The search index is currently processing. Current results may not be complete.


More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

  • Audio
    • Music and Sound FX
  • Business
    • Business and Law
    • Career Development
    • Production and Management
  • Game Design
    • Game Design and Theory
    • Writing for Games
    • UX for Games
  • Industry
    • Interviews
    • Event Coverage
  • Programming
    • Artificial Intelligence
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Engines and Middleware
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
  • Archive

Categories

  • Audio
  • Visual Arts
  • Programming
  • Writing

Categories

  • Game Dev Loadout
  • Game Dev Unchained

Categories

  • Game Developers Conference
    • GDC 2017
    • GDC 2018
  • Power-Up Digital Games Conference
    • PDGC I: Words of Wisdom
    • PDGC II: The Devs Strike Back
    • PDGC III: Syntax Error

Forums

  • Audio
    • Music and Sound FX
  • Business
    • Games Career Development
    • Production and Management
    • Games Business and Law
  • Game Design
    • Game Design and Theory
    • Writing for Games
  • Programming
    • Artificial Intelligence
    • Engines and Middleware
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
    • 2D and 3D Art
    • Art Critique and Feedback
  • Community
    • GameDev Challenges
    • GDNet+ Member Forum
    • GDNet Lounge
    • GDNet Comments, Suggestions, and Ideas
    • Coding Horrors
    • Your Announcements
    • Hobby Project Classifieds
    • Indie Showcase
    • Article Writing
  • Affiliates
    • NeHe Productions
    • AngelCode
  • Topical
    • Virtual and Augmented Reality
    • News
  • Workshops
    • C# Workshop
    • CPP Workshop
    • Freehand Drawing Workshop
    • Hands-On Interactive Game Development
    • SICP Workshop
    • XNA 4.0 Workshop
  • Archive
    • Topical
    • Affiliates
    • Contests
    • Technical
  • GameDev Challenges's Topics
  • For Beginners's Forum
  • Unreal Engine Users's Unreal Engine Group Forum
  • Unity Developers's Forum
  • Unity Developers's Asset Share

Calendars

  • Community Calendar
  • Games Industry Events
  • Game Jams
  • GameDev Challenges's Schedule

Blogs

There are no results to display.

There are no results to display.

Product Groups

  • Advertisements
  • GameDev Gear

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Website


Role


Twitter


Github


Twitch


Steam

Found 95 results

  1. Hi, I am working on Unity 2019.2 and I am using C# code in Visual Studio Code 1.38.1 but since 2 days, I found a bug in connection with Unity and Visual Studio code that i can not open C# file with double click on it in Visual studio code.Now please help me to solve out this kind of issue in Unity and Visual Studio Code. Thanks, Gaurang
  2. I am using SignalR and I can't get a C# command to call the printinitial JavaScript function. I have a similar example that works fine. When debugging it does step on this. I've been scratching my head for hours, please help me. Here are the two functions, what could it be? C#.net : public void register(string name) { int myplayernumber = -1; A_client.ConnectionId = Context.ConnectionId; A_client.Name = name; ClientList.Add(A_client); if (integer == 0) { myplayernumber = 1; integer = integer + 1; } else if (integer == 1) { Clients.Client(ClientList[0].ConnectionId).printinitial(); myplayernumber = 2; } if (myplayernumber == 2) { Clients.Client(ClientList[1].ConnectionId).printinitial(); } } HTML / JavaScript / JQuery chat.client.printinital = function () { $("#turn").html("print_this"); }; Thank you, Josheir
  3. 8Observer8

    C# GUI WPF + OpenGL 3.1

    We will see how to place OpenTK.GLControl on WPF window to make GUI application with 2D/3D graphics using modern OpenGL 3. This is the result VS project: EditedTriangle_WPFOpenGL31CSharp.zip How to create the project from scratch Note 1: RMB - Right Mouse Button click Note 2: Good Color calculator for normalized values: http://doc.instantreality.org/tools/color_calculator/ Create WPF application, with the name "EditedTriangle". See the screenshot: Download OpenTK.GLControl.zip and OpenTK.zip Create the empty "Libs" folder in the solution folder (where the ".sln" is placed) Unzip "OpenTK" and "OpenTK.GLControl" folder in the "Libs" folder Add references to "OpenTK.dll" and "OpenTK.GLControl.dll". For this: RMB on "References" -> select "Add Reference..." -> select "Browse" -> click the "Browse..." button -> select DLL's. See the screenshot with the result: Add "Assemblies". For this: select "Assemblies" -> "Framework" -> check: System.Drawing System.Windows.Forms WindowsFormsIntegration , see the screenshot with the result: Click "OK" button Open the file "MainWindow.xaml" in VS. Add this line as an attribute of the "Window" element: xmlns:opentk="clr-namespace:OpenTK;assembly=OpenTK.GLControl" Place this code inside of <Window></Window> element: <Grid> <DockPanel LastChildFill="True"> <StackPanel DockPanel.Dock="Right"> <Button x:Name="buttonSetBGColor" Content="Set BG Color" Margin="5" Click="buttonSetBGColor_Click"></Button> <Button x:Name="buttonSetTRColor" Content="Set TR Color" Margin="5" Click="buttonSetTRColor_Click"></Button> </StackPanel> <WindowsFormsHost Margin="5" Initialized="WindowsFormsHost_Initialized"> <opentk:GLControl x:Name="glControl" Load="glControl_Load" Paint="glControl_Paint" /> </WindowsFormsHost> </DockPanel> </Grid> Copy the code below to "MainWindow.xaml.cs" and run the project MainWindow.xaml.cs using System; using System.Windows; using OpenTK; using OpenTK.Graphics; using OpenTK.Graphics.OpenGL; namespace Triangle_OpenGL31WPF { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { private Utils.ShaderProgram _program; private Matrix4 _projMatrix; private int _startIndex = 0; private int _amountOfVertices = 3; public MainWindow() { InitializeComponent(); } private void WindowsFormsHost_Initialized(object sender, EventArgs e) { glControl.MakeCurrent(); } private void glControl_Load(object sender, EventArgs e) { GL.ClearColor(new Color4(0.631f, 0.6f, 0.227f, 1f)); _program = new Utils.ShaderProgram( "Shaders/vShader.glsl", "Shaders/fShader.glsl"); if (_program.Id == -1) { MessageBox.Show(string.Format("Error: see the file \"{0}\"", Utils.Logger.logFileName)); return; } InitVertexBuffers(); SetTriangleColor(Color4.Red); int uProjMatrix = GL.GetUniformLocation(_program.Id, "uProjMatrix"); if (uProjMatrix < 0) { Utils.Logger.Append("Failed to get uProjMatrix location"); return; } _projMatrix = Matrix4.CreateOrthographicOffCenter(-1f, 1f, -1f, 1f, 1f, -1f); GL.UniformMatrix4(uProjMatrix, false, ref _projMatrix); } private void InitVertexBuffers() { float[] vertices = new float[] { // Triangle 0.0f, 0.5f, // (x, y) -0.5f, -0.5f, 0.5f, -0.5f }; // Create a vertex buffer object int vbo; GL.GenBuffers(1, out vbo); // Bind the VBO to target GL.BindBuffer(BufferTarget.ArrayBuffer, vbo); // Write the data into the VBO GL.BufferData(BufferTarget.ArrayBuffer, vertices.Length * sizeof(float), vertices, BufferUsageHint.StaticDraw); // Get the storage location of the aPosition int aPosition = GL.GetAttribLocation(_program.Id, "aPosition"); if (aPosition < 0) { Utils.Logger.Append("Failed to get the storage location of the aPosition"); return; } // Assign the VBO to aPosition variable GL.VertexAttribPointer(aPosition, 2, VertexAttribPointerType.Float, false, 0, 0); // Enable the assignment GL.EnableVertexAttribArray(aPosition); } private void glControl_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { GL.Viewport(0, 0, glControl.Width, glControl.Height); // Fill a canvas GL.Clear(ClearBufferMask.ColorBufferBit); if (_amountOfVertices > 0) { GL.DrawArrays(PrimitiveType.TriangleStrip, _startIndex, _amountOfVertices); } // Swap the front and back buffers glControl.SwapBuffers(); } private void buttonSetBGColor_Click(object sender, RoutedEventArgs e) { var dialog = new System.Windows.Forms.ColorDialog(); if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { float r = dialog.Color.R / 255f; float g = dialog.Color.G / 255f; float b = dialog.Color.B / 255f; GL.ClearColor(new Color4(r, g, b, 1f)); glControl.Invalidate(); } } private void buttonSetTRColor_Click(object sender, RoutedEventArgs e) { var dialog = new System.Windows.Forms.ColorDialog(); if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { float r = dialog.Color.R / 255f; float g = dialog.Color.G / 255f; float b = dialog.Color.B / 255f; SetTriangleColor(new Color4(r, g, b, 1f)); glControl.Invalidate(); } } private void SetTriangleColor(Color4 color) { int uTriangleColor = GL.GetUniformLocation(_program.Id, "uTriangleColor"); if (uTriangleColor < 0) { Utils.Logger.Append("Failed to get uTriangleColor location"); return; } Vector3 c = new Vector3(color.R, color.G, color.B); GL.Uniform3(uTriangleColor, ref c); } } } MainWindow.xaml <Window x:Class="Triangle_OpenGL31WPF.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:Triangle_OpenGL31WPF" xmlns:opentk="clr-namespace:OpenTK;assembly=OpenTK.GLControl" mc:Ignorable="d" Title="Triangle" Height="256" Width="290"> <Grid> <DockPanel LastChildFill="True"> <StackPanel DockPanel.Dock="Right"> <Button x:Name="buttonSetBGColor" Content="Set BG Color" Margin="5" Click="buttonSetBGColor_Click"></Button> <Button x:Name="buttonSetTRColor" Content="Set TR Color" Margin="5" Click="buttonSetTRColor_Click"></Button> </StackPanel> <WindowsFormsHost Margin="5" Initialized="WindowsFormsHost_Initialized"> <opentk:GLControl x:Name="glControl" Load="glControl_Load" Paint="glControl_Paint" /> </WindowsFormsHost> </DockPanel> </Grid> </Window>
  4. Hi. My name is Jan and I'm working on horror adventure game called Akolyta. I work togheter with my friend on the game and we are working on demo version for early access. We would love to see new talented developers who would be willing to help us with the development for free in their free time. If you would like to know more about the game feel free to visit game website: http://akolyta.pterosoftstudio.com We are currently looking for: 3D Environment Artist Prop Artist Marketing Manager Concept Artist Sound Designer/Composer C++ Programmer If you're interested, feel free to contact us via email (info@pterosoftstudio.com) or on our Discord channel.
  5. Long story short, the 600+ variables required to make Battle Gem Ponies work have been put into a new usable form that'll make what's coming next possible. With all the ingredients finally here it's time to whip up a fresh and playable version of the game! See the full Patreon Exclusive post here! Otherwise come get a glimpse of the game's upcoming development tasks on the Yotes Blog.
  6. Awhile back MarcusAseth posted this picture In it he asked about the blue box and arrow. I too was stumped by it, and no one came back to answer. Original Post: Turns out the blue arrow is when you have the source code in the parent directory to the project file. I guess it was to tell a developer the file is located higher in the directory structure then the project file. Hopefully anyone looking for an answer on this will find it.
  7. Normally something I would follow up on in a Microsoft forum, but thought I'd drop in here first... I had migrated my project from Visual Studio 2010 to Visual Studio 2017 late last year, and everything went smoothly. Just recently, however, I was reviving a testing harness I was using for network code and have been encountering a linker error that is slightly befuddling. Specifically, only in my release builds, I get these: MSVCRT.lib(delete_array.obj) : error LNK2005: "void __cdecl operator delete[](void *)" (??_V@YAXPEAX@Z) already defined in MSVCRT.lib(delete_array.obj) MSVCRT.lib(delete_scalar.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPEAX@Z) already defined in MSVCRT.lib(delete_scalar.obj) Now, normally the first stop in MSVCRT linker errors is to check and make sure all the CRT code generation settings are matching across all libs (Multithreaded DLL, etc.). I have meticulously checked ALL settings 6 times over to ensure they match. But then, things are actually a little strange when you consider that in this particular case it's complaining that something in MSVCRT.lib is already defined in...MSVCRT.lib. That's interesting. I do have my own overrides for global new and delete, and commenting out the specific ones noted in the link errors does get things linking error-free. It is worth noting that my overrides are NOT inlined (I guess these days, it's actually not allowed). Further, why it is *only* those two variants (not the std::nothrow_t variants), and only delete (no issues with the overridden new(s)) is a bit perplexing. Even more, I am using said overrides/library in many other projects without this issue (and as noted, this was not an issue in this particular project back in Visual Studio 2010). This smells to me like a Visual Studio 2017 linker issue, but I thought I'd pop in here and see if anyone had seen something similar?
  8. Hello, So im not quite sure what term to use for this, but as the title says, i would like to create a custom build step. In Visual Studio i can see that there are options for this, such as "Custom Build Step" and "Build Events" properties. Im not sure if these are the right ones or how to really go about using them for what i would like to do. So what i would like to accomplish is to be able to add new custom preprocessor functions, like __FILE__, __LINE__ etc. Is there an existing solution for doing things like this? Example of what i would like to do: // what the developer see struct Object { const char * getName() const { return __OBJECT_NAME__; } }; // what the compiler see struct Object { const char * getName() const { return "Object"; } }; Looking at the existing options that i know of so far, i could use the "Build Events" and from the pre step allow a custom tool to go in and parse and generate code. This however seems like going the long way instead of the intended route. And i would then have to restore the files to their original state after compilation was completed. Also, this might be a stretch. But being able to do something like this would be awesome. // what the developer see template< class T > struct Object { const char * getTypeName() const { return __TYPE_NAME__(T); } }; // what the compiler see template< class T > struct Object { const char * getTypeName() const { return "int"; // or whatever type T is } }; So that would mean that the tool / buildstep would have to be injected at the right time after templates have been resolved and im just guessing that this is out of the question.. Looking at the "Custom Build Step" options im not quite sure how i would use that, it dident look like it would be a step in the right direction for the problem im trying to solve, but maby im just missing something. Suggestions and ideas are very welcome
  9. I have made a simple 2D game supposed to run on Windows only using SFML. The executable is built using Visual Studio 2017. I would like to make sure that it can run on as many Windows machines as possible (even on Windows 7/8 if possible). What steps can I take to ensure that? I have done the following: Build for Win32 (x86) not x64 platform In Project Properties->C/C++->Code Generation, I set Runtime Library to Multi-threaded (runtime library should thus be statically packed with the exe) not Multi-Threaded DLL Would the following help with compatibility (and not cause problems with forward compatibility)? Using Windows SDK version 8.1? Use older platform toolset (not Visual Studio 2017 v141 but perhaps VS 2015 v140 or even VS 2015 Windows XP) What else can I do, and what should I be aware of? Thanks.
  10. Hello I'm a beginner in game programming and I'm programming in visual studio 2017 with OpenGL and SDL2 libraries Every time I try to build my project i have this problem and i don't what is the problem: 1>------ Build started: Project: TheGame, Configuration: Debug Win32 ------ 1>Cube.cpp 1>c:\users\king0k13\documents\games\thegame\thegame\game.h(18): error C2143: syntax error: missing ';' before '*' 1>c:\users\king0k13\documents\games\thegame\thegame\game.h(18): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>Main.cpp 1>Generating Code... 1>Done building project "TheGame.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== These are my Project files: - Game.h #pragma once #ifndef _GAME_H_ #define _GAME_H_ #include <iostream> #include <SDL.h> #include <SDL_opengl.h> #include <SOIL.h> #include <gl/gl.h> #include <string> #include "Cube.h" #define ScreenWidth 600 #define ScreenHeight 600 Cube* cube1; class Game { public: // Constructors Game(); ~Game(); // Functions void Initialize(); void SetOpenGLAttributes(); void InputHandler(); void Update(); void Render(); void Clean(); // Globals bool RunningStatus; private: SDL_Window* GameScreen; SDL_GLContext GameContext; SDL_Event GameEvents; }; #endif Error Line is: Cube* cube1; --------------------------------------------------------------------------------------------------------------- - Game.cpp #include "Game.h" Game::Game() { } Game::~Game() { } /****************************************************************************/ void Game::Initialize() { // Initilizng SDL if (SDL_Init(SDL_INIT_VIDEO) == 0) { std::cout << "SDL Initialized succesfully!" << std::endl; } else { std::cout << "Failed Initializing SDL : " << SDL_GetError() << std::endl; RunningStatus = false; } // Setting-Up The Game Screen GameScreen = SDL_CreateWindow("The Game", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, ScreenWidth, ScreenHeight, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN); if (GameScreen == NULL) // Handling Errors { std::cout << "SDL Failed Creating Window : " << SDL_GetError() << std::endl; RunningStatus = false; } else { std::cout << "Creating Window Succesful!" << std::endl; std::cout << "Window Data : \n" << "\tTitle : The Game\n\tX , Y Position : (CENTERED , CENTERED)\n\tWidth and Height : (" << ScreenWidth << " , " << ScreenHeight << ")\n\tFlags : OpenGL | Shown\n" << std::endl; } // Creating Game Context for OpenGL use GameContext = SDL_GL_CreateContext(GameScreen); SetOpenGLAttributes(); // Setting OpenGLAttributes SDL_GL_SetSwapInterval(1); RunningStatus = true; // Turning on The Game Loop cube1->LoadTexture(); cube1->ActiveTexture(); } /****************************************************************************/ void Game::SetOpenGLAttributes() { SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); } /****************************************************************************/ void Game::InputHandler() { while (SDL_PollEvent(&GameEvents)) { switch (GameEvents.type) { case SDL_QUIT: RunningStatus = false; break; case SDL_KEYDOWN: switch (GameEvents.key.keysym.sym) { case SDLK_w: break; case SDLK_a: break; case SDLK_s: break; case SDLK_d: break; default: break; } break; default: break; } } } /****************************************************************************/ void Game::Update() { cube1->SetPosition(0, 0); } /****************************************************************************/ void Game::Render() { SDL_GL_SwapWindow(GameScreen); } /****************************************************************************/ void Game::Clean() { cube1->UnloadTexture(); SDL_GL_DeleteContext(GameContext); SDL_DestroyWindow(GameScreen); SDL_Quit(); } ----------------------------------------------------------------------------------------------------------------- - Cube.h #pragma once #ifndef _CUBE_H_ #define _CUBE_H_ #include "Game.h" class Cube { public: // Constractors Cube(); ~Cube(); // Functions void SetPosition(int x, int y); int GetPosition(); void LoadTexture(); void ActiveTexture(); void UnloadTexture(); // Globals //bool Hide; private: // Cube Position int X_pos; int Y_pos; //int Z_pos; // Cube Graphic unsigned char* CubeTexture; GLuint TextureID; int Channels; int Format; int T_Width; int T_Height; }; #endif ----------------------------------------------------------------------------------------------------------------- Cube.cpp #include "Cube.h" Cube::Cube() { } Cube::~Cube() { } /****************************************************************************/ void Cube::SetPosition(int x, int y) { X_pos = x; Y_pos = y; } /****************************************************************************/ int Cube::GetPosition() { return X_pos, Y_pos; } /****************************************************************************/ void Cube::LoadTexture() { Channels = 0; CubeTexture = SOIL_load_image("assets/Block.png", &T_Width, &T_Height, &Channels, SOIL_LOAD_AUTO); if (CubeTexture == NULL) { std::cout << "SOIL Failed to Load Texture" << std::endl; } Format = GL_RGB; if (Channels == 4) { Format = GL_RGBA; } glGenTextures(1, &TextureID); glBindTexture(GL_TEXTURE_2D, TextureID); glTexImage2D(GL_TEXTURE_2D, 0, Format, T_Width, T_Height, 0, Format, GL_UNSIGNED_BYTE, CubeTexture); SOIL_free_image_data(CubeTexture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); } void Cube::ActiveTexture() { glBindTexture(GL_TEXTURE_2D, TextureID); } void Cube::UnloadTexture() { glDeleteTextures(1, &TextureID); } ------------------------------------------------------------------------------------------------------------------- - Main.cpp #include "Game.h" int main(int argc, char* argv[]) { Game TheGame; TheGame.Initialize(); while (TheGame.RunningStatus) { TheGame.InputHandler(); TheGame.Update(); TheGame.Render(); } TheGame.Clean(); return 0; } I would be really happy if someone helps me to fix the error. P.S. : If someone have any good advice to help me coding my project better please tell me!
  11. Hello! I need some advice on my new library, I'm not really confident about it... First a little of introduction: One of my biggest problems when creating a game or a game engine was how to perform the resource management (loading files, editing them, etc). I could just use a default "Data" folder, put all my files here and load them using the standard ways but we know that this is something problematic when the project starts to grow. I also don't think (or at least I don't know) there is a good library that could help with this task. Yeah I could use zlib or something like that but I decided to create my own, I did some improvements here and there, created a decent (at least I think) introduction/tutorial on its git page but I really don't know if any developer would use it on its currently state. Here is the link https://github.com/RodrigoHolztrattner/Packet (written in c++). It uses hashed paths to perform fast-mapping searches, it has 2 operation modes (one that allows editing and the other that is focused on performance), all resources uses reference counting and it has some other things that are listed on its github page (like the hot-reload capability for example). Unfortunatelly there are no working examples for now but I plan to add them in the future. Now I ask you, what do you think about using a library like this? Is it something that you would use for your game? Have I done some kind of overthinking when building it? Like I said I'm not really confident about it (although I'm using it on my projects and I feel it suit them really nice). Thank you for your time!
  12. Updated: 2/15/2019 - added "if...else" Double Selection Statement Visual Studio Enterprise 2015 has build in tool for creating UML Activity Diagrams. We can use this tool for creating flowcharts for describing algorithms. Creating UML Activity Diagram: Select: "File" -> "New" -> "Project..." -> "Modeling Projects" Write a name, for example: UseUMLInsteadOfFlowcharts_ModelingProject Press "OK" button Right Click on a name of the project Select: "Add" -> "New Item..." -> "UML Activity Diagram" Write a name, for example: UseUMLInsteadOfFlowcharts.activitydiagram Press "Add" button To add new items, drag them from the "Toolbox" I get these examples from the book: 2016 - 08 - C# 6 for Programmers - 6th Edition - Paul Deitel, Harvey Deitel. Code Examples: link 1. "if" Single-Selection Statement int studentGrade = 70; if (studentGrade >= 60) { Console.WriteLine("Passed"); } 2. "if...else" Double-Selection Statement int studentGrade = 70; if (studentGrade >= 60) { Console.WriteLine("Passed"); } else { Console.WriteLine("Failed"); } 3. "while" Iteration Statement int product = 3; while (product <= 100) { product = 3 * product; } 4. "for" Iteration Statement for (int counter = 1; counter <= 10; ++counter) { Console.Write($"{counter} "); }
  13. Before I will start I want to advise you to read this book: The Art of Unit Testing: with examples in C#. Yes, as you can see this book contains examples in C# but it is not important. This book contain very useful and important information how to write unit tests. I made an example of project in VS 2015: SortFunctions.zip This project will show you how set up Google Test in Visual Studio and run simple unit tests. Note. If you have another version of VS then before you will run unit tests you need to select VS 2017, like in this screenshot: Google Test library is included in the project as source folder and it is placed in "Libs" folder. You need to: open the solution. The solution is file with name: "SortFunctions.sln" select your version of VS, for example VS 2017 instead of VS 2015 as in screenshot above make the "SortFunction_UnitTests" project as "StartUp Project". For this: make right mouse button click on the "SortFunction_UnitTests" project -> select "Set as StartUp Project" press Ctrl+F5 to run unit tests You will see this settings in the "SortFunction_UnitTests" project properties: $(SolutionDir)Libs\gtest-1.8.1\include $(SolutionDir)Libs\gtest-1.8.1 $(SolutionDir)SortFunction This solution include two projects: SortFunctions - this project contains modules that we want to test. For example, bubbleSort() method SortFunctions_UnitTests - this project contains unit tests Add existing files to the "SortFunctions_UnitTests" project: YourSolutionDir/Libs/gtest-1.8.1/src/gtest-all.cc YourSolutionDir/SortFunctions/SortFunctions.cpp The "SortFunctions" project has two files: SortFunctions.h #pragma once extern void bubbleSort(int *array, unsigned int amount); extern void countingSort(int *array, unsigned int amount); SortFunctions.cpp #include "SortFunctions.h" void bubbleSort(int *array, unsigned int amount) { } void countingSort(int *array, unsigned int amount) { } The "SortFunctions_UnitTests" project has tests. For example, this is the "bubbleSortTests.cpp" with two tests. The first test is for positive numbers and the second test is for negative numbers: bubbleSortTests.cpp #include <gtest/gtest.h> #include "SortFunctions.h" TEST(bubbleSortTest, AllPositiveElements) { // Arrange const unsigned int amount = 5; int actualArray[amount] = { 5, 3, 10, 2, 7 }; int expectedArray[amount] = { 2, 3, 5, 7, 10 }; // Act bubbleSort(actualArray, amount); // Assert for (size_t i = 0; i < amount; i++) { ASSERT_EQ(expectedArray[i], actualArray[i]); } } TEST(bubbleSortTest, AllNegativeElements) { // Arrange const unsigned int amount = 5; int actualArray[amount] = { -5, -3, -10, -2, -7 }; int expectedArray[amount] = { -10, -7, -5, -3, -2 }; // Act bubbleSort(actualArray, amount); // Assert for (size_t i = 0; i < amount; i++) { ASSERT_EQ(expectedArray[i], actualArray[i]); } } main.cpp #include <gtest/gtest.h> int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }
  14. Dear Colony Managers, prepare yourselves to build some beautiful ocean districts for your people! In addition there are loads of detail improvements that give the overall playability a huge boost! Mostly based on testing and your highly appreciated feedback. Special thanks to Johannes for improving our german translation! TL;DR Display info icons during colony placement Trade discounts and surcharges Ocean district UI improvements for research, colony shares and workshop List of gameplay improvements New rendering system for buildings and world objects Colony Placement Placing a new colony or frontier building now displays icons on the surrounding fields. The represent the quality of the area by highlighting deserts, fields with high fertility, fossil or rare resources and more. Trade Discounts The price of resources and items always depends on who you are trading with. Space merchants and tech traders will charge a fee that makes buying more expensive and selling less lucrative. Natives and midras on the other side don’t know a lot about space market prices and often sell stuff very cheap. Other colonists, finally, link their pricing to your diplomatic relation. This means it can be very powerful to have a good relation towards another company. Ocean District This new district is now made available in the Lorian mission. The ocean district can be built on coast fields and the open sea. Districts have to be linked to others who connect with the shore. Microplastic collectors clean the seas and recover goods by filtering floating plastic, other waste and impurities from the water. Ocean thermal energy conversion uses the temperature difference between cooler deep sea and warmer surface water to meet part of the energy demand. UI Improvements Research Only display elements of buildings that are already available (the buildings don’t have to be licensed, though) Highlight research options by improved category: energy, food, goods, income, emissions Colony Share Trading Take-over of a city no longer needs at least 50% of shares Clearly display the player’s stake in another colony Tooltip with transaction fee and expected dividend Workshop Unite different item categories in single panel with scroll bars Other UI Stuff Added „mission failed“ dialog to competitions Highlight when an opposing faction is almost winning the competition „Back“ buttons in game are now called „resume game“ to make it more clear Infrastructure buildings now have gray icons Gameplay In competition and free play other factions will no longer wait until you have placed your first city center Forests and other plants regrow much faster now after being harvested or burnin