Ejemplo n.º 1
0
        public void AddUseCase()
        {
            if (Actors == null || !Actors.Any())
            {
                return;
            }

            this.mainViewModelHandler.UseCases.Add(new UseCaseViewModel(selectedActor, selectedUseCaseType, name));
        }
Ejemplo n.º 2
0
        public bool IsValid()
        {
            if (ScheduleStartsAt != DateTime.MinValue &&
                ScheduleEndsAt != DateTime.MinValue &&
                Actors != null &&
                Busy != null &&
                Tasks != null)
            {
                return(Actors.Any() && Busy.Any() && Tasks.Any());
            }

            return(false);
        }
Ejemplo n.º 3
0
        public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
        {
            List <ValidationResult> errors = new List <ValidationResult>();

            if (Actors != null && Actors.Any())
            {
                bool duplicates = Actors.GroupBy(a => a).Any(a => a.Count() > 1);
                if (duplicates)
                {
                    errors.Add(new ValidationResult("Duplicate actors", new[] { "Actors" }));
                }
            }

            return(errors);
        }
Ejemplo n.º 4
0
        public VoiceActorInformationViewModel(Project project)
        {
            m_currentId = 0;
            m_project   = project;
            if (Actors.Any())
            {
                m_currentId = Actors.Max(a => a.Id) + 1;
            }

            foreach (var actor in Actors)
            {
                var characterGroup = project.CharacterGroupList.GetGroupsAssignedToActor(actor.Id).FirstOrDefault();
                m_originalActors.Add(new Tuple <VoiceActor.VoiceActor, CharacterGroup>(actor.MakeCopy(), characterGroup));
            }
        }
Ejemplo n.º 5
0
        public GameTile[] GetMaskedViewportWithViewcones(Point2i size, Point2i position, GameGrid <bool> visibilityGrid, GameGrid <bool> guardVisibilityGrid)
        {
            var maskedViewport = GetMaskedViewport(size, position, visibilityGrid);

            foreach (var kvp in Items)
            {
                if (visibilityGrid[kvp.Key] && !Actors.Any(a => a.Position == kvp.Key))
                {
                    maskedViewport[PositionToIndex(kvp.Key)] = kvp.Value.Presentation;
                }
            }

            for (var i = 0; i < maskedViewport.Length; i++)
            {
                if (guardVisibilityGrid[i] && visibilityGrid[i])
                {
                    maskedViewport[i] = new GameTile(maskedViewport[i].Glyph, maskedViewport[i].Foreground, Colors.GuardVisibility);
                }
            }

            return(maskedViewport);
        }
Ejemplo n.º 6
0
 public bool ShouldSerializeActors()
 {
     return(Actors.Any());
 }
Ejemplo n.º 7
0
 public bool IsActor(Cell cell)
 {
     return(Actors.Any(entry => entry.Position != null && entry.Position.Cell == cell));
 }
Ejemplo n.º 8
0
 public bool IsActorOnPoint(Point point)
 {
     return(IsPawnOnPoint(point) ||
            Actors.Any(actor => point == actor.Position));
 }