Skip to content

Instantly share code, notes, and snippets.

@twsiyuan twsiyuan/Composition.cs
Last active Jul 4, 2016

Embed
What would you like to do?
class BasicObject
{
public int hp { get; set; }
public int mp { get; set; }
public int attack { get; set; }
}
class PlayerData
{
BasicObject basic = new BasicObject();
public BasicObject Basic { get{ return this.basic; } }
// Others
}
class EnemyData
{
BasicObject basic = new BasicObject();
public BasicObject Basic { get{ return this.basic; } }
// Others
}
class FriendData
{
BasicObject basic = new BasicObject();
public BasicObject Basic { get{ return this.basic; } }
// Others
}
class BasicObject
{
public int hp { get; set; }
public int mp { get; set; }
public int attack { get; set; }
}
class PlayerData : BasicObject
{
// Others
}
class EnemyData : BasicObject
{
// Others
}
class FriendData : BasicObject
{
// Others
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.