// // Character.cs - represents a character in a Concertroid Performance // // Author: // Michael Becker // // Copyright (c) 2011-2020 Mike Becker's Software // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . using System; namespace UniversalEditor.ObjectModels.Concertroid { /// /// Represents a character in a Concertroid . /// public class Character : ICloneable { public class CharacterCollection : System.Collections.ObjectModel.Collection { } /// /// Gets or sets the given name of the . /// /// The given name of the . public string GivenName { get; set; } = String.Empty; /// /// Gets or sets the family name of the . /// /// The family name of the . public string FamilyName { get; set; } = String.Empty; /// /// Gets or sets the full name of the in "Given Family" format. /// /// The full name of the in "Given Family" format. public string FullName { get { return GivenName + " " + FamilyName; } set { if (value.Contains(" ")) { string[] dup = value.Split(new char[] { ' ' }, 2); if (dup.Length > 1) { GivenName = dup[0]; FamilyName = dup[1]; } else { GivenName = dup[0]; FamilyName = String.Empty; } } } } /// /// Gets or sets the full path to the file containing the base 3D character model (without costume). /// /// The full path to the file containing the base 3D character model (without costume). public string BaseModelFileName { get; set; } = String.Empty; /// /// Gets a collection of instances representing the languages associated with this . /// /// The languages associated with this . public Language.LanguageCollection Languages { get; } = new Language.LanguageCollection(); /// /// Gets a collection of instances representing the costumes associated with this . /// /// The costumes associated with this . public Costume.CostumeCollection Costumes { get; } = new Costume.CostumeCollection(); public object Clone() { Character clone = new Character(); clone.GivenName = (GivenName.Clone() as string); clone.FamilyName = (FamilyName.Clone() as string); clone.BaseModelFileName = (BaseModelFileName.Clone() as string); foreach (Costume costume in Costumes) { clone.Costumes.Add(costume.Clone() as Costume); } return clone; } } }