Beispiel #1
0
        private void SaveCharButton_Click(object sender, EventArgs e)
        {
            SWEntity pc = EntityFactory.NewEntityFromCGWindow(selectedComponents);

            foreach (var comp in pc.GetComponents <Defines.Components.TraitComponent>())
            {
                string test = $"{comp.Name} of {comp.Parent}: {comp.Target} with {comp.Effect}";
                System.Console.WriteLine(test);
            }
            System.Console.WriteLine($"G: {pc.Gender} S: {pc.Sexuality}");
            Data.World.SetPlayer(pc);
        }
        public static SWEntity NewEntityFromCGWindow(List <string> components)
        {
            var ent = new SWEntity(1, 1);

            ent.InitializeAsParent((1, 1), 1);
            foreach (var item in components)
            {
                var component = new TraitComponent(Entities.Traits[item].Name, Entities.Traits[item].Description,
                                                   Entities.Traits[item].Cost, Entities.Traits[item].Effect,
                                                   Entities.Traits[item].Target);
                ent.AddComponent(component);
                if (component.Category == "Sexuality")
                {
                    ent.Sexuality = component.Name;
                }
            }

            return(ent);
        }
Beispiel #3
0
 public static void SetPlayer(SWEntity value)
 {
     player = value;
 }