コード例 #1
0
        public Hair(HairStyleEnum _style, HairLengthEnum _length, ColorEnum _color, string _description)
        {
            this._style       = _style;
            this._length      = (_style == HairStyleEnum.BALD) ? HairLengthEnum.NONE : _length;
            this._color       = _color;
            this._description = (_description == null) ? "" : _description;

            WfLogger.Log(this, LogLevel.DETAILED, "Created Hair (" + this._style + ", " + this._length + ", " + this._color + ")");
        }
コード例 #2
0
        // --------------------------------------------------------------------------------------------------------------------------------
        // --------------------------------------------------------------------------------------------------------------------------------

        /// <summary>
        /// Change the hair style to the given value
        /// </summary>
        /// <param name="newHairStyle">all BodyTypeEnum values are valid</param>
        /// <returns>true if successful, false otherwise</returns>
        public bool ChangeStyle(HairStyleEnum newHairStyle)
        {
            if (newHairStyle == _style)
            {
                WfLogger.Log(this, LogLevel.INFO, "Didn't change hair style, because it already was " + _style);
                return(false);
            }
            _style = newHairStyle;
            WfLogger.Log(this, LogLevel.DEBUG, "Changed hair style to " + _style);
            return(true);
        }