Example #1
0
        public override ICrowd CloneMemberships()
        {
            CrowdModel clonedCrowdModel = new CrowdModel(this.Name);

            foreach (var member in this.crowdMemberCollection)
            {
                if (member is CrowdModel)
                {
                    clonedCrowdModel.Add((member as CrowdModel).CloneMemberships() as ICrowdMemberModel);
                }
                else
                {
                    clonedCrowdModel.Add(member);
                }
            }
            clonedCrowdModel.crowdMemberCollection = new HashedObservableCollection <ICrowdMemberModel, string>(clonedCrowdModel.CrowdMemberCollection, x => x.Name, x => x.Order, x => x.Name);
            clonedCrowdModel.CrowdMemberCollection = new ReadOnlyHashedObservableCollection <ICrowdMemberModel, string>(clonedCrowdModel.crowdMemberCollection);
            return(clonedCrowdModel);
        }
Example #2
0
        private void SpawnModels(object obj)
        {
            int x = 0;

            foreach (string model in SelectedModels)
            {
                if (tmpCrowd.CrowdMemberCollection.Any(m => m.Name == model))
                {
                    continue;
                }
                CrowdMemberModel tmpChar = charExpVM.GetNewCharacter(model, model, IdentityType.Model) as CrowdMemberModel;
                tmpCrowd.Add(tmpChar);
                tmpChar.Spawn();
                tmpChar.Position.X += x++ *3;
            }
        }