Ejemplo n.º 1
0
 public override void Tick()
 {
     base.Tick();
     ReceiveableMan = null;
     if (Clock.IsDay())
     {
         foreach (Person t in Homeless)
         {
             if (Insider.Contains(t))
             {
                 if (t.Company)
                 {
                     t.GoJob();
                 }
                 else if (t.Work)
                 {
                     t.GoWork();
                 }
                 else if (!t.acting)
                 {
                     ReceiveableMan = t;
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
 public virtual void CheckConstruction()
 {
     if (ConstructTime < 0)
     {
         UnderConstruct = false;
         Working        = true;
         for (int i = 0; i < Insider.Count; i++)
         {
             Insider[i].AddCommand(new ChangeWorkCommand(null));
             if (((Person)Insider[i]).Company)
             {
                 Insider[i].AddCommand(new GoJobCommand());
             }
             else
             {
                 Insider[i].AddCommand(new GoHomeCommand());
             }
         }
         Insider.Clear();
         ConstructionIndicator.SetActive(false);
         Model.SetActive(true);
     }
     else
     {
         ConstructTime -= Time.deltaTime * Insider.Count;
     }
 }
Ejemplo n.º 3
0
 public override void Tick()
 {
     base.Tick();
     ReceiveableMan = null;
     if (Clock.IsDay())
     {
         foreach (Person t in Officers)
         {
             if (Insider.Contains(t) && t.Work)
             {
                 t.GoWork();
             }
             else
             {
                 ReceiveableMan = t;
             }
         }
     }
     else
     {
         foreach (Unit t in Officers)
         {
             if (Insider.Contains(t))
             {
                 t.GoHome();
             }
         }
     }
 }
Ejemplo n.º 4
0
 public override void Tick()
 {
     base.Tick();
     ReceiveableMan = null;
     if (Clock.IsDay())
     {
         foreach (Human t in Livers)
         {
             if (Insider.Contains(t) && !t.acting)
             {
                 ReceiveableMan = t;
             }
         }
         if (Working && !UnderConstruct && !UnderDeconstruct)
         {
             if (Workers.Count > 0)
             {
                 BirthStatus += BirthSpeed;
                 if (BirthStatus >= BirthCap)
                 {
                     BirthStatus = 0f;
                     Human t = Instantiate(personPrefab);
                     TriIsland.Instance.entities.AddUnit(t);
                     t.Location = Location;
                     t.Home     = this;
                     t.AddCommand(new GetInCommand(this));
                     while (Workers.Count > 0)
                     {
                         (Workers[0] as Human).Work = null;
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 5
0
        private bool AttachWithTries(Process process, int times)
        {
            bool result;

            try
            {
                LaunchInjector(process);

                Thread.Sleep(500);

                result = Insider.IsAlive();
            }
            catch (Exception)
            {
                result = false;
            }

            if (result)
            {
                return(true);
            }

            if (times > 0)
            {
                Thread.Sleep(1000);

                return(AttachWithTries(process, times - 1));
            }

            return(false);
        }
Ejemplo n.º 6
0
        public PartialViewResult EmbeddedArticle(string articlehandle)
        {
            ExtronWeb.Models.Article article        = new ExtronWeb.Models.Article();
            InsiderEntity            currentInsider = Insider.GetCurrentInsider();
            var model = article.GetArticle(articlehandle, currentInsider);

            return(PartialView("../Widgets/EmbeddedArticle", model));
        }
Ejemplo n.º 7
0
        public ActionResult DeleteConfirmed(int id)
        {
            Insider insider = db.Insiders.Find(id);

            db.Insiders.Remove(insider);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 8
0
        public IHttpActionResult Get()
        {
            InsiderEntity insider = Insider.GetCurrentInsider();

            if (insider == null)
            {
                return(NotFound());
            }
            return(Ok(insider));
        }
Ejemplo n.º 9
0
 public ActionResult Edit([Bind(Include = "InsiderID,UserName,InsiderFirstName,InsiderLastName,AddressID,InsiderEmailAddress,InsiderPhoneNumber")] Insider insider)
 {
     if (ModelState.IsValid)
     {
         db.Entry(insider).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AddressID = new SelectList(db.Addresses, "AddressID", "StreetAddress", insider.AddressID);
     return(View(insider));
 }
Ejemplo n.º 10
0
        // GET: Article
        public ActionResult Index(string articlehandle)
        {
            ExtronWeb.Models.Article article        = new ExtronWeb.Models.Article();
            InsiderEntity            currentInsider = Insider.GetCurrentInsider();
            var model = article.GetArticle(articlehandle, currentInsider);

            if (model != null)
            {
                return(View(model));
            }
            return(Redirect("/"));
        }
Ejemplo n.º 11
0
        public IHttpActionResult GetPricing(string partnum)
        {
            InsiderEntity       insider = Insider.GetCurrentInsider();
            AvantePricingEntity pricing = Price.GetInsiderPrice(partnum, insider);
            ProdPricing         result  = new ProdPricing()
            {
                YourPrice = pricing.DealerPrice.GetPrice(),
                MSRP      = pricing.ListPrice.GetPrice()
            };

            return(Ok(result));
        }
Ejemplo n.º 12
0
 public override void Tick()
 {
     base.Tick();
     if (Clock.IsDay())
     {
         foreach (Human t in Homeless)
         {
             if (Insider.Contains(t) && !t.acting)
             {
                 ReceiveableMan = t;
             }
         }
     }
 }
Ejemplo n.º 13
0
        // GET: Insiders/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Insider insider = db.Insiders.Find(id);

            if (insider == null)
            {
                return(HttpNotFound());
            }
            return(View(insider));
        }
Ejemplo n.º 14
0
        // GET: Insiders/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Insider insider = db.Insiders.Find(id);

            if (insider == null)
            {
                return(HttpNotFound());
            }
            ViewBag.AddressID = new SelectList(db.Addresses, "AddressID", "StreetAddress", insider.AddressID);
            return(View(insider));
        }
Ejemplo n.º 15
0
 public override void Tick()
 {
     base.Tick();
     CommandReceiver = null;
     if (Clock.IsDay())
     {
         foreach (Person t in Livers)
         {
             if (Insider.Contains(t))
             {
                 if (t.Company)
                 {
                     t.GoJob();
                 }
                 else if (t.Work)
                 {
                     t.GoWork();
                 }
                 else
                 {
                     CommandReceiver = t;
                 }
             }
         }
         if (Working && !UnderConstruct)
         {
             if (Workers.Count > 0)
             {
                 BirthStatus += BirthSpeed;
                 if (BirthStatus >= BirthCap)
                 {
                     BirthStatus = 0f;
                     Person t = Instantiate(personPrefab);
                     TriIsleland.Instance.entities.AddUnit(t);
                     t.Location = Location;
                     t.Home     = this;
                     t.AddCommand(new GetInCommand(this));
                     while (Workers.Count > 0)
                     {
                         (Workers[0] as Person).Work = null;
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 16
0
        public JsonResult SubmitTopicFeedback(ExtronWeb.Models.Help.Help.FeedbackEntity feedback)
        {
            var model = new TopicViewModel();

            InsiderEntity currentInsider = Insider.GetCurrentInsider();

            if (currentInsider.Email == null)
            {
                feedback.Email = "NO_LOGIN";
            }
            else
            {
                feedback.Email = currentInsider.Email;
            }

            feedback.UserAgent = HttpContext.Request.UserAgent;
            feedback.IPAddress = Request.UserHostAddress;

            if (model.SubmitTopicFeedback(feedback))
            {
                return(Json(feedback));
            }
            return(null);
        }
Ejemplo n.º 17
0
        public ActionResult Login()
        {
            InsiderEntity currentInsider = Insider.GetCurrentInsider();

            return(View(currentInsider));
        }