Skip to content

Instantly share code, notes, and snippets.

@nelsonlaquet
Created May 11, 2012 01:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nelsonlaquet/2656977 to your computer and use it in GitHub Desktop.
Save nelsonlaquet/2656977 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ClassLibrary1;
namespace ConsoleApplication1
{
static class Whoa
{
public static int GetInt(string from)
{
Console.WriteLine("Getting an int from {0}", from);
return 4;
}
}
class Base
{
private int _baseStuff;
public Base()
{
_baseStuff = Whoa.GetInt("Base._baseStuff");
Whoa.GetInt("From base ctor");
}
}
class Person : Base
{
private int _health;
private int _mana;
private int _whoa;
public Person()
{
_health = Whoa.GetInt("Person._health");
_mana = Whoa.GetInt("Person._mana");
_whoa = Whoa.GetInt("Person._whoa");
Whoa.GetInt("From person ctor");
}
public void TakeDamage(int damage)
{
_health -= damage;
if (_health > 0)
return;
Console.WriteLine("YOU DIED!");
}
}
class Program
{
static void Main(string[] args)
{
var p = new Person();
Console.ReadKey();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment