- Home /
Development / Live Build Coding
Hey there,
i have an architectural question,
i would like to separate parts of my game in two environments: development and production
I use DynamoDB and i would like to separate "real" data from "test" data. Thats why i have two tables for my player:
[DynamoDBTable("production_player")]
public class PlayerProduction
{
[DynamoDBHashKey]
public string Id { get; set; }
[DynamoDBProperty]
public string Name { get; set; }
}
[DynamoDBTable("development_player")]
public class PlayerDevelopment
{
[DynamoDBHashKey]
public string Id { get; set; }
[DynamoDBProperty]
public string Name { get; set; }
}
So far so good...BUT :
When i use these tables, i do:
if (developmentVersion)
{
var newPlayer = new PlayerDevelopment
{
Id = "someId",
Name = "someName"
};
DynamoDBContext.SaveAsync<PlayerDevelopment>(newPlayer, (result) =>
{
if (result.Exception == null)
{
// good
}
else
{
// not good
}
});
}
else
{
var newPlayer = new PlayerProduction
{
Id = "someId",
Name = "someName"
};
DynamoDBContext.SaveAsync<PlayerProduction>(newPlayer, (result) =>
{
if (result.Exception == null)
{
// good
}
else
{
// not good
}
});
}
As you can see, this looks quite primitive... Isnt there any nicer way to seperate environments or do you know better ways to handle this case?
Greetings and thanks!
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
An OS design issue: File types associated with their appropriate programs 1 Answer
Distribute terrain in zones 3 Answers
Revmob Unity SDK for Amazon 0 Answers