Ejemplo n.º 1
0
        /// <summary>
        /// Player
        /// </summary>
        /// <param name="aPlayerName"></param>
        /// <param name="aLocation"></param>
        public Player(string aPlayerName, Location3i aLocation)
            : base()
        {
            // Create the players key-chain
            KeyChain = new KeyChain();

            // Create the players wallet.
            Wallet = new Currency(0);

            G = '@';
            Name = aPlayerName;
            Location = aLocation;
            C = new Colour() { FG = ConsoleColor.Gray };
            Stats = new Stats()
            {
                Agility = 2,
                Charisma = 4,
                Endurance = 7,
                Intelligence = 7,
                Luck = 4,
                Perception = 2,
                Strength = 7,
            };

            Initialize();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create a new instance of Actor.
        /// </summary>
        public Actor()
        {
            // Create inventory collection for this actor.
            Inventory = new ItemCollection();

            // Active effects on this actor.
            EffectStack = new List<Effect>();

            // The actors stats.
            Stats = new Stats();

            WieldedWeapons = new WeaponsWielded();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// ReadStats, read a full out stats object from standard-in.
        /// This is only for properties that *can* be read.
        /// </summary>
        /// <returns></returns>
        public static Stats ReadStats()
        {
            // Get all properties for a stats object and set them via user input.
            Stats retVal = new Stats();
            foreach (var p in typeof(Stats).GetProperties())
            {
                if (p.CanWrite)
                {
                    var pSet = p.GetSetMethod();
                    pSet.Invoke(retVal, new object[] { Input.GetInt(p.Name + ": ") });
                }

                UI.Graphics.CursorToLocation(1, 1);
                Console.Write("                   ");
            }

            return retVal;
        }