Exemple #1
0
        private List <DBActor> GetActors()
        {
            // Download actor list
            GetActors actors = new GetActors(SeriesId);

            return(actors.Actors);
        }
        public IEnumerable <GetActorsResult> Execute(GetActors query)
        {
            var c = RepositoryFactory.GetInstance <TBL_ACTORS>().GetAll().ToList();

            return((from rows in c
                    select new GetActorsResult()
            {
                Name = rows.Name,
                Sex = rows.Sex,
                Bio = rows.Bio,
                DOB = rows.DOB,
                ActorId = rows.ActorId
            }).OrderBy(data => data.ActorId));
        }
Exemple #3
0
        private void DeleteActorThumbs()
        {
            GetActors actors = new GetActors(SeriesId);

            foreach (DBActor actor in actors.Actors)
            {
                string fileName = actor.Image;
                if (string.IsNullOrEmpty(fileName))
                {
                    continue;
                }

                try
                {
                    File.Delete(actor.Image);
                }
                catch (Exception e)
                {
                    MPTVSeriesLog.Write("Unable to delete actor image '{0}', {1}", fileName, e.Message);
                }
            }
        }
Exemple #4
0
 private List<DBActor> GetActors()
 {
     // Download actor list
     GetActors actors = new GetActors(SeriesId);
     return actors.Actors;
 }
Exemple #5
0
        private void DeleteActorThumbs()
        {
            GetActors actors = new GetActors(SeriesId);

            foreach (DBActor actor in actors.Actors)
            {
                string fileName = actor.Image;
                if (string.IsNullOrEmpty(fileName)) continue;

                try
                {
                    File.Delete(actor.Image);
                }
                catch (Exception e)
                {
                    MPTVSeriesLog.Write("Unable to delete actor image '{0}', {1}", fileName, e.Message);
                }
            }
        }
Exemple #6
0
    [NonSerialized] bool firstLoop = true; protected override void Update()
    {
        base.Update();
        if (!OutOfSight_v &&
            deadStance != -1)
        {
            Debug.LogWarning("I'm dead! :(");
            if (Dying <= 0)
            {
                setOutOfSight();
            }
            else
            {
                Dying -= Time.deltaTime;
            }
        }


        #region Init
        if (firstLoop && !Contains(this))
        {
            if (LOG && LOG_LEVEL <= 100)
            {
                Debug.LogWarning("unregistered actor id detected processed by the manager; actor isn't marked to be active but is enabled anyway: this causes it to be ignored by other actors: actors must be enabled by their manager", this.gameObject);
            }
        }
        #endregion
        #region OutOfSight response
        if (OutOfSight_disable)
        {
            gameObject.transform.root.gameObject.SetActive(false);
            if (GetActors.ContainsKey(Id))
            {
                GetActors.Remove(Id);
                if (LOG && LOG_LEVEL <= 0)
                {
                    Debug.Log("disable OutOfSight actor and add to inactive queue");
                }
                InactiveActorsByTypeId[TypeId].AddLast(this);
            }
            else
            {
                if (LOG && LOG_LEVEL <= 100)
                {
                    Debug.LogWarning("OutOfSight actor wasn't marked to be active so it should already be in its InactiveActorsByTypeId queue");
                }
            }
            OutOfSight_disable = false;
            return;
        }
        #endregion


        if (this is _3DSprite)
        {
            if (sfx != null)
            {
                if (MyMotion == Motions.MOTION_STAND)
                {
                    sfx.Play((int)ActorSounds._IDLE);
                }
                else if (MyMotion == Motions.MOTION_MOVE)
                {
                    sfx.Play((int)ActorSounds._MOVE);
                }
            }
        }


        if (DEBUG_ATTACK)
        {
            Attack(null);
        }
        if (DEBUG_GETHIT)
        {
            DEBUG_GETHIT = false; TakeDamage(null);
        }
        if (DEBUG_DIE)
        {
            DEBUG_DIE = false; Die();
        }


        if (LOG && LOG_LEVEL <= 0)
        {
            Debug.Log("MySight.IsInHearingSight.Count:" + MySight.IsInHearingSight.Count + ";MySight.IsInVisionSight.Count:" + MySight.IsInVisionSight.Count);
        }
        GetTargets();

        actorTouchingMe = false;
        enemyTouchingMe = false;
        if (collisions.Count > 0)
        {
            foreach (var collision in collisions)
            {
                if (collision.Key.gameObject.CompareTag("Player"))
                {
                    actorTouchingMe = true;
                }
                if (MyEnemy != null && collision.Key.gameObject.CompareTag("Player") && collision.Key.gameObject.GetComponent <AI>() == MyEnemy)
                {
                    enemyTouchingMe = true;
                }
                if (actorTouchingMe && enemyTouchingMe)
                {
                    break;                //  Break when all checks are true, so only on O(n) operation is processed for any needed check
                }
            }
        }

//Debug.LogWarning("nextAttackTimer:"+nextAttackTimer);
        if (nextAttackTimer > 0)
        {
            nextAttackTimer -= Time.deltaTime;
            if (LOG && LOG_LEVEL <= -110)
            {
                Debug.Log("waiting for nextAttackTimer to get to zero [" + this, this);
            }
        }
        if (Autonomous <= 0)
        {
            WALK_PATH();


            doingAttackMoveAway = false;
            if (MyState == State.EXCUSE_ST)
            {
                OnEXCUSE_ST();
            }
            if (MyState == State.FOLLOW_ST)
            {
                OnFOLLOW_ST();
            }
            if (MyState == State.IDLE_ST)
            {
                OnIDLE_ST();
            }
            if (MyState == State.CHASE_ST)
            {
                OnCHASE_ST();
            }
            if (MyState == State.ATTACK_ST)
            {
                OnATTACK_ST();
            }
            if (MyState == State.SKILL_OBJECT_ST)
            {
                OnSKILL_OBJECT_ST();
            }
        }
        else
        {
            Autonomous -= Time.deltaTime;
        }
        firstLoop = false;
    }