Example #1
0
        /// <summary>
        /// Creates a new instance of <see cref="NPCViewModel"/>
        /// </summary>
        public NPCViewModel(NPCModel npcModel)
        {
            _npcModel = npcModel;

            if (!String.IsNullOrWhiteSpace(npcModel.Name))
            {
                _name = npcModel.Name;
            }
            else
            {
                _name = "Unknown Name";
            }

            if (_npcModel.Tags.Any())
            {
                _tags = String.Join(", ", _npcModel.Tags);
            }
            else
            {
                _tags = "None";
            }

            _occupation      = _stringService.UnknownIfNullOrEmpty(_npcModel.Occupation);
            _backstory       = _stringService.UnknownIfNullOrEmpty(_npcModel.Backstory);
            _ideal           = _stringService.UnknownIfNullOrEmpty(_npcModel.Ideal);
            _bond            = _stringService.UnknownIfNullOrEmpty(_npcModel.Bond);
            _flaw            = _stringService.UnknownIfNullOrEmpty(_npcModel.Flaw);
            _appearance      = _stringService.UnknownIfNullOrEmpty(_npcModel.Appearance);
            _abilities       = _stringService.UnknownIfNullOrEmpty(_npcModel.Abilities);
            _mannerism       = _stringService.UnknownIfNullOrEmpty(_npcModel.Mannerism);
            _interactions    = _stringService.UnknownIfNullOrEmpty(_npcModel.Interactions);
            _usefulKnowledge = _stringService.UnknownIfNullOrEmpty(_npcModel.UsefulKnowledge);
        }