public ObservableCollection <CharacterActionGroup> GetStandardCharacterActionGroup(ManagedCharacter character)
        {
            var actionGroup = new ObservableCollection <CharacterActionGroup>();

            var identitiesGroup = new CharacterActionListImpl <Identity>(CharacterActionType.Identity, character.Generator, character);

            identitiesGroup.Name = "Identities";

            //Identity newId = identitiesGroup.AddNew(new IdentityImpl()) as Identity;
            IdentityImpl newId = new IdentityImpl();

            newId.Owner     = null;
            newId.Name      = "Identity";
            newId.Type      = SurfaceType.Costume;
            newId.Surface   = "Identity";
            newId.Generator = character.Generator;
            identitiesGroup.AddNew(newId);
            identitiesGroup.Active = newId;

            actionGroup.Add(identitiesGroup);

            var abilitiesGroup = new CharacterActionListImpl <AnimatedAbility.AnimatedAbility>(CharacterActionType.Ability, character.Generator, character);

            abilitiesGroup.Name = "Powers";

            actionGroup.Add(abilitiesGroup);

            var movementsGroup = new CharacterActionListImpl <CharacterMovement>(CharacterActionType.Movement, character.Generator, character);

            movementsGroup.Name = "Movements";

            actionGroup.Add(movementsGroup);

            return(actionGroup);
        }
Esempio n. 2
0
        public CharacterActionList <T> Clone()
        {
            var cloneList = new CharacterActionListImpl <T>(Type, Generator, Owner);

            foreach (var anAction in this)
            {
                var clone = (T)anAction.Clone();
                cloneList.InsertAction(clone);
            }
            return(cloneList);
        }
Esempio n. 3
0
        private void CreateIdentityActionGroup()
        {
            var identitiesGroup = new CharacterActionListImpl <Identity>(CharacterActionType.Identity, Generator, this);

            identitiesGroup.Name = IDENTITY_ACTION_GROUP_NAME;

            Identity newId = new IdentityImpl();

            newId.Owner     = this;
            newId.Name      = Name;
            newId.Type      = SurfaceType.Costume;
            newId.Surface   = Name;
            newId.Generator = this.Generator;
            identitiesGroup.AddNew(newId);
            identitiesGroup.Active = newId;

            this.CharacterActionGroups.Add(identitiesGroup);
        }
        public void AddActionGroup()
        {
            string newActionGroupName     = this.EditedCharacter.GetnewValidActionGroupName();
            CharacterActionGroup actGroup = new CharacterActionListImpl <CharacterAction>(CharacterActionType.Mixed, this.EditedCharacter.Generator, this.EditedCharacter);

            actGroup.Name = newActionGroupName;
            this.EditedCharacter.AddActionGroup(actGroup);
            CharacterActionGroupViewModelImpl <CharacterAction> mixedActionGroup = null;

            try
            {
                mixedActionGroup = IoC.Get <CharacterActionGroupViewModelImpl <CharacterAction> >();
            }
            catch
            {
                mixedActionGroup = new CharacterActionGroupViewModelImpl <CharacterAction>(this.DesktopKeyEventHandler, this.EventAggregator);
            }
            mixedActionGroup.ActionGroup         = actGroup;
            mixedActionGroup.NewActionGroupAdded = true;
            this.CharacterActionGroups.Add(mixedActionGroup);
            this.EventAggregator.Publish(new CrowdCollectionModifiedEvent(), action => System.Windows.Application.Current.Dispatcher.Invoke(action));
        }