Comments (9)
I've started work on it, should I put the enum-to-string class/method in the same .cs file or separate it?
from pubg-dotnet.
Yeah moving the regions to enums is definitely something that I intended to do. Probably the thing to do is rather than having a ToString on it, I have a json converter in another project that will just convert it to a string at serialization so we just deal with it as the enum and then let newtonsoft take care of converting it to a string behind the scenes.
from pubg-dotnet.
My mistake actually it's built into Json.Net I'll use the game modes for example
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.Runtime.Serialization;
[JsonConverter(typeof(StringEnumConverter))]
public enum PubgGameMode
{
[EnumMember(Value = "squad")]
Squad,
[EnumMember(Value = "solo")]
Solo,
[EnumMember(Value = "duo")]
Duo
}
When that's serialized it'll output the value specified in the enum member attribute, saves having to write anything extra
from pubg-dotnet.
And yeah definitely any suggestions you can come up with feel free to throw in an issue or DM me on Discord
from pubg-dotnet.
I'll be out for the rest of the night (I'm in GMT) but I'll respond first thing in the morning
from pubg-dotnet.
Ah okay. I'll use the JsonConverter then.
from pubg-dotnet.
I don't know enough about GitHub, but do you think you could give me permissions to push to the repository? Both GitHub desktop and the Visual Studio plugin like to fuck me over.
from pubg-dotnet.
Added you as a Contributor, will review the PR now
from pubg-dotnet.
PR Merged Closing
from pubg-dotnet.
Related Issues (20)
- Why are matchids empty?
- Missing Krakin Map Name
- Updating JsonApiSerializer from 1.3.1 to 1.74 HOT 1
- Add more maintainers
- Update to be in line with API 1.2.0 HOT 1
- Add is custom match flag HOT 1
- PUBG new Map HOT 3
- GetPubgMatchesRequest is missing HOT 7
- Create more documentation HOT 3
- Create Tournament Service HOT 1
- Warmodefpp Game Mode Not Found HOT 11
- Changing PubgGameMode to String HOT 1
- Relationship Id's are lost on multiple deserializations HOT 1
- Message "Unable to find specified resource" string HOT 3
- Service Methods Split into PC and Xbox for 2.0.0 and Potential Delays HOT 3
- Json Exception HOT 2
- Always NullReferenceException HOT 4
- New map 'DihorOtok_Main' HOT 3
- DBNO information
- PubgGameMode enum is out of date HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pubg-dotnet.