Exemple #1
0
 public void EndInspiration(Inspiration inspiration)
 {
     if (inspiration != null)
     {
         if (curState != inspiration)
         {
             Log.Error("Tried to end inspiration " + inspiration.ToStringSafe() + " but current inspiration is " + curState.ToStringSafe());
             return;
         }
         curState = null;
         inspiration.PostEnd();
     }
 }
 public void EndInspiration(Inspiration inspiration)
 {
     if (inspiration == null)
     {
         return;
     }
     if (this.curState != inspiration)
     {
         Log.Error("Tried to end inspiration " + inspiration.ToStringSafe <Inspiration>() + " but current inspiration is " + this.curState.ToStringSafe <Inspiration>());
         return;
     }
     this.curState = null;
     inspiration.PostEnd();
 }
 public void EndInspiration(Inspiration inspiration)
 {
     if (inspiration != null)
     {
         if (this.curState != inspiration)
         {
             Log.Error("Tried to end inspiration " + inspiration.ToStringSafe <Inspiration>() + " but current inspiration is " + this.curState.ToStringSafe <Inspiration>(), false);
         }
         else
         {
             this.curState = null;
             inspiration.PostEnd();
         }
     }
 }
 public bool TryStartInspiration(InspirationDef def)
 {
     if (this.Inspired)
     {
         return(false);
     }
     if (!def.Worker.InspirationCanOccur(this.pawn))
     {
         return(false);
     }
     this.curState      = (Inspiration)Activator.CreateInstance(def.inspirationClass);
     this.curState.def  = def;
     this.curState.pawn = this.pawn;
     this.curState.PostStart();
     return(true);
 }
Exemple #5
0
 public bool TryStartInspiration_NewTemp(InspirationDef def, string reason = null)
 {
     if (Inspired)
     {
         return(false);
     }
     if (!def.Worker.InspirationCanOccur(pawn))
     {
         return(false);
     }
     curState        = (Inspiration)Activator.CreateInstance(def.inspirationClass);
     curState.def    = def;
     curState.pawn   = pawn;
     curState.reason = reason;
     curState.PostStart();
     return(true);
 }
        public bool TryStartInspiration(InspirationDef def)
        {
            bool result;

            if (this.Inspired)
            {
                result = false;
            }
            else if (!def.Worker.InspirationCanOccur(this.pawn))
            {
                result = false;
            }
            else
            {
                this.curState      = (Inspiration)Activator.CreateInstance(def.inspirationClass);
                this.curState.def  = def;
                this.curState.pawn = this.pawn;
                this.curState.PostStart();
                result = true;
            }
            return(result);
        }
 public void Reset()
 {
     this.curState = null;
 }
Exemple #8
0
 public void Reset()
 {
     curState = null;
 }