Exemplo n.º 1
0
    public static IEnumerator RemoveOrganCoroutine(Organ organ, float seconds, int goldCost, float bloodLossRateInduced, float damageInduced)
    {
        Clock clock = MonoBehaviour.FindObjectOfType <Clock>();

        clock.StartClockUntil(seconds);

        ButtonActions buttonActions = MonoBehaviour.FindObjectOfType <ButtonActions>();

        buttonActions.UpdateMenuButtonsInteractivity(false);

        buttonActions.ActionInProgress();
        while (clock.isTimePassing)
        {
            RemoveOrganDuring(organ, clock, seconds, bloodLossRateInduced, damageInduced);
            yield return(null);
        }
        buttonActions.ActionFinished();

        if (!clock.actionCancelFlag)
        {
            RemoveOrganProcess(organ);
            GameObject.FindObjectOfType <GoldTracker>().goldSpent += goldCost;
            buttonActions.SelectSurgeryAction();
        }
    }
Exemplo n.º 2
0
    public static void ImplantOrganProcess(Organ organ, BodyPart bodyPart)
    {
        //connect
        organ.CreateConnection(bodyPart);
        bodyPart.AddContainedOrgan(organ);
        try
        {
            if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "SampleScene")
            {
                GameObject.FindObjectOfType <BodyPartSelectorManager>().ResetSelectors();
                GameObject.FindObjectOfType <EmbeddedObjectSelectorManager>().ResetSelectors();
                MonoBehaviour.FindObjectOfType <BodyPartStatusManager>().UpdateStatusCollection();
            }
        }
        catch (System.Exception e)
        {
            Debug.LogError($"ImplantOrganProcess: {e}");
        }

        UpdateAllBodyPartHeartConnections();

        //make organ child of bodypart
        organ.transform.SetParent(bodyPart.transform);

        MonoBehaviour.FindObjectOfType <ActionTracker>().surgery_organtransplant += 1;
    }
Exemplo n.º 3
0
    public void OnSow(SowPlant2Type Sow)
    {
        SowingData = Sow;

        // Go through all our children and find all organs.
        Organs.Clear();
        foreach (object ChildObject in My.ChildrenAsObjects)
        {
            Organ Child = ChildObject as Organ;
            if (Child != null)
            {
                Organs.Add(Child);
            }
        }

        if (NewCrop != null)
        {
            NewCropType Crop = new NewCropType();
            Crop.crop_type = CropType;
            Crop.sender    = Name;
            NewCrop.Invoke(Crop);
        }

        if (Sowing != null)
        {
            Sowing.Invoke();
        }

        // tell all our children about sow
        foreach (Organ Child in Organs)
        {
            Child.OnSow(Sow);
        }
    }
Exemplo n.º 4
0
    public static void RemoveOrganProcess(Organ organ)
    {
        //disconnect
        BodyPart organParent = organ.connectedBodyParts[0];

        organ.SeverAllConnections();
        try
        {
            if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "SampleScene")
            {
                GameObject.FindObjectOfType <BodyPartSelectorManager>().ResetSelectors(organParent);
                GameObject.FindObjectOfType <EmbeddedObjectSelectorManager>().ResetSelectors();
                MonoBehaviour.FindObjectOfType <BodyPartStatusManager>().UpdateStatusCollection();
            }
        }
        catch (System.Exception e)
        {
            Debug.LogError(e);
        }

        UpdateAllBodyPartHeartConnections();

        //remove from being child of bodypart
        organ.transform.SetParent(organ.transform.parent.parent);

        MonoBehaviour.FindObjectOfType <ActionTracker>().surgery_organremovals += 1;
    }
Exemplo n.º 5
0
        public void Insert(Organ o)
        {
            var _context = new DataContext();

            _context.Organs.Add(o);
            _context.SaveChanges();
        }
        protected override void Context()
        {
            base.Context();
            _parameters = new List <IParameter>();
            var brain           = new Organ().WithName(CoreConstants.Organ.BRAIN);
            var brain_pls       = new Compartment().WithName(CoreConstants.Compartment.PLASMA).WithParentContainer(brain);
            var brain_pls_trans = new Container().WithName(_transporter.Name).WithParentContainer(brain_pls);
            var relExp2Param    = DomainHelperForSpecs.ConstantParameterWithValue(0).WithName(CoreConstants.Parameters.REL_EXP)
                                  .WithParentContainer(brain_pls_trans);

            relExp2Param.Origin.SimulationId = "Sim";

            var liver        = new Organ().WithName(CoreConstants.Organ.LIVER);
            var liver_cell   = new Container().WithName(CoreConstants.Compartment.INTRACELLULAR).WithParentContainer(liver);
            var liver_enz    = new Container().WithName(_enzyme.Name).WithParentContainer(liver_cell);
            var relExp1Param = DomainHelperForSpecs.ConstantParameterWithValue(0).WithName(CoreConstants.Parameters.REL_EXP)
                               .WithParentContainer(liver_enz);

            relExp1Param.Origin.SimulationId = "Sim";

            _referenceConcentrationParam     = DomainHelperForSpecs.ConstantParameterWithValue(0).WithName(CoreConstants.Parameters.REFERENCE_CONCENTRATION);
            _halfLifeLiverParameter          = DomainHelperForSpecs.ConstantParameterWithValue(0).WithName(CoreConstants.Parameters.HALF_LIFE_LIVER);
            _halfLifeLiverIntestineParameter = DomainHelperForSpecs.ConstantParameterWithValue(0).WithName(CoreConstants.Parameters.HALF_LIFE_INTESTINE);

            _parameters.AddRange(new[]
                                 { _halfLifeLiverParameter, _halfLifeLiverIntestineParameter, _referenceConcentrationParam, relExp1Param, relExp2Param });
        }
Exemplo n.º 7
0
        /// <summary>
        /// 获取某个类型标识部门列表
        /// </summary>
        /// <param name="type">类型标识</param>
        /// <returns>结果列表</returns>
        public IList <Organ> SELECT_BY_TYPE(string type)
        {
            try
            {
                IList <Organ> result = new List <Organ>();
                var           temp   = (from row in db.S_organ where row.type == type orderby row.name ascending select row).GetEnumerator();
                while (temp.MoveNext())
                {
                    Organ element = new Organ();

                    element.Id          = temp.Current.id;
                    element.Name        = temp.Current.name;
                    element.Description = temp.Current.description;
                    element.Type        = temp.Current.type;
                    element.Isused      = temp.Current.isused;

                    result.Add(element);
                }
                return(result);
            }
            catch
            {
                return(null);
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// 更新函数
        /// </summary>
        /// <param name="info">Model</param>
        /// <returns>影响数据物理ID,已存在逻辑主码返回-1</returns>
        public int UPDATE(Organ info)
        {
            try
            {
                if (SELECT_BY_NAME_ISUSED(info.Name, true) != null)
                {
                    return(-1);
                }

                S_organ         temp  = new S_organ();
                Table <S_organ> table = db.GetTable <S_organ>();
                temp = (from row in db.S_organ where row.id == info.Id select row).First();

                //temp.id = info.Id;
                temp.name        = info.Name;
                temp.description = info.Description;
                temp.type        = info.Type;
                temp.isused      = info.Isused;

                db.SubmitChanges();
                return(temp.id);
            }
            catch
            {
                return(-2);
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// 插入函数
        /// </summary>
        /// <param name="info">Model</param>
        /// <returns>影响数据物理ID,已存在逻辑主码项返-1</returns>
        public int INSERT(Organ info)
        {
            try
            {
                if (SELECT_BY_NAME_ISUSED(info.Name, true) != null)
                {
                    return(-1);
                }

                S_organ temp = new S_organ();
                //temp.id = info.Id;
                temp.name        = info.Name;
                temp.description = info.Description;
                temp.type        = info.Type;
                temp.isused      = info.Isused;

                Table <S_organ> table = db.GetTable <S_organ>();
                table.InsertOnSubmit(temp);
                db.SubmitChanges();
                return(temp.id);
            }
            catch
            {
                return(-2);
            }
        }
Exemplo n.º 10
0
        public void SubSetBodyPart(BodyPart bodyPart, string path)
        {
            path = path + "/" + bodyPart.name;
            if (OpenBodyCustomisation.ContainsKey(bodyPart.name))
            {
                CustomisationStorage Customisation = null;
                foreach (var bodyPartCustomisation in bodyPartCustomisationStorage)
                {
                    if (bodyPartCustomisation.path == path)
                    {
                        Customisation = bodyPartCustomisation;
                    }
                }

                if (Customisation != null)
                {
                    var TCustomisation = OpenBodyCustomisation[bodyPart.name];
                    TCustomisation.Deserialise(Customisation.Data.Replace("@£", "\""));
                }
            }

            if (bodyPart?.Storage?.Populater?.Contents != null)
            {
                foreach (var Organ in bodyPart.Storage.Populater.Contents)
                {
                    var subBodyPart = Organ.GetComponent <BodyPart>();
                    SubSetBodyPart(subBodyPart, path);
                }
            }
        }
Exemplo n.º 11
0
        public ReturnResult <Organ> InsertOrgan(Organ organ)
        {
            List <Organ> organList  = new List <Organ>();
            DbProvider   dbProvider = new DbProvider();
            string       outCode    = String.Empty;
            string       outMessage = String.Empty;
            int          totalRows  = 0;

            dbProvider.SetQuery("Organ_INSERT", CommandType.StoredProcedure)
            .SetParameter("TenCoQuan", SqlDbType.NVarChar, organ.OrganName, 50, ParameterDirection.Input)
            .SetParameter("DiaChiID", SqlDbType.Int, organ.AddressID, ParameterDirection.Input)
            .SetParameter("TinhID", SqlDbType.Int, organ.ProvincialID, ParameterDirection.Input)
            .SetParameter("HuyenID", SqlDbType.Int, organ.DistrictID, ParameterDirection.Input)
            .SetParameter("XaPhuongID", SqlDbType.Int, organ.WardsID, ParameterDirection.Input)
            .SetParameter("LoaiCoQuan", SqlDbType.Int, organ.OrganTypeID, ParameterDirection.Input)
            .SetParameter("NgayCapNhat", SqlDbType.Int, organ.UpdateTime, ParameterDirection.Input)
            .SetParameter("ErrorCode", SqlDbType.NVarChar, DBNull.Value, 100, ParameterDirection.Output)
            .SetParameter("ErrorMessage", SqlDbType.NVarChar, DBNull.Value, 4000, ParameterDirection.Output)
            .GetList <Organ>(out organList)
            .Complete();
            dbProvider.GetOutValue("ErrorCode", out outCode)
            .GetOutValue("ErrorMessage", out outMessage);

            return(new ReturnResult <Organ>()
            {
                ItemList = organList,
                ErrorCode = outCode,
                ErrorMessage = outMessage,
                TotalRows = totalRows
            });
        }
Exemplo n.º 12
0
    public void OnEndCrop()
    {
        NewCropType Crop = new NewCropType();

        Crop.crop_type = CropType;
        Crop.sender    = Name;
        if (CropEnding != null)
        {
            CropEnding.Invoke(Crop);
        }

        // Keep track of some variables for reporting.
        Biomass AboveGroundBiomass = new Biomass(AboveGround);
        Biomass BelowGroundBiomass = new Biomass(BelowGround);

        // Call each organ's OnHarvest. They fill a BiomassRemoved structure. We then publish a
        // BiomassRemoved event.
        BiomassRemovedType BiomassRemovedData = new BiomassRemovedType();

        foreach (Organ1 Organ in Organ1s)
        {
            Organ.OnEndCrop(BiomassRemovedData);
        }
        BiomassRemovedData.crop_type = CropType;
        BiomassRemoved.Invoke(BiomassRemovedData);

        Console.WriteLine("    Organic matter from crop:-      Tops to surface residue      Roots to soil FOM");
        Console.WriteLine(string.Format("                      DM (kg/ha) = {0,21:F1}{1,24:F1}",
                                        AboveGroundBiomass.Wt, BelowGroundBiomass.Wt));
        Console.WriteLine(string.Format("                      N  (kg/ha) = {0,22:F2}{1,24:F2}",
                                        AboveGroundBiomass.N, BelowGroundBiomass.N));
        //Console.WriteLine(string.Format("                      P  (kg/ha) = {0,22:F2}{1,24:F2}",
        //                                AboveGroundBiomass.P, BelowGroundBiomass.P));
    }
Exemplo n.º 13
0
        public void Delete(Organ o)
        {
            var _context = new ApplicationDbContext();

            _context.Organs.Remove(o);
            _context.SaveChanges();
        }
Exemplo n.º 14
0
    public void OnClick()
    {
        if (GameManager.Instance.selectedTool != Tools.None && organ != null)
        {
            TryCraft();
        }
        else
        {
            Organ newOrgan     = GameManager.Instance.organSlots.SelectedOrgan;
            int   selectedSlot = GameManager.Instance.organSlots.GetSelectedId();
            GameManager.Instance.organSlots.SelectedOrgan = null;

            if (organ != null)
            {
                GameManager.Instance.organSlots.PlaceOrganAtPos(organ, selectedSlot);
                organ = null;
            }

            if (newOrgan != null)
            {
                newOrgan.transform.SetParent(organPos);
                LeanMover.Instance.Move(newOrgan.gameObject, organPos.position);
                organ = newOrgan;
            }
        }
    }
        protected override void Context()
        {
            base.Context();
            _simulation.RemoveAllBuildingBlockOfType(PKSimBuildingBlockType.Individual);
            _parameters = new List <IParameter>();
            var kidney         = new Organ().WithName(CoreConstants.Organ.KIDNEY);
            var kidney_cell    = new Compartment().WithName(CoreConstants.Compartment.INTRACELLULAR).WithParentContainer(kidney);
            var kid_cell_trans = new Container().WithName(_transporter.Name).WithParentContainer(kidney_cell);
            var relExp2Param   = DomainHelperForSpecs.ConstantParameterWithValue(0).WithName(CoreConstants.Parameters.REL_EXP)
                                 .WithParentContainer(kid_cell_trans);

            relExp2Param.Origin.SimulationId = "Sim";

            var liver        = new Organ().WithName(CoreConstants.Organ.LIVER);
            var liver_cell   = new Container().WithName(CoreConstants.Compartment.INTRACELLULAR).WithParentContainer(liver);
            var liver_enz    = new Container().WithName(_enzyme.Name).WithParentContainer(liver_cell);
            var relExp1Param = DomainHelperForSpecs.ConstantParameterWithValue(0).WithName(CoreConstants.Parameters.REL_EXP)
                               .WithParentContainer(liver_enz);

            relExp1Param.Origin.SimulationId = "Sim";

            _referenceConcentrationParam     = DomainHelperForSpecs.ConstantParameterWithValue(0).WithName(CoreConstants.Parameters.REFERENCE_CONCENTRATION);
            _halfLifeLiverParameter          = DomainHelperForSpecs.ConstantParameterWithValue(0).WithName(CoreConstants.Parameters.HALF_LIFE_LIVER);
            _halfLifeLiverIntestineParameter = DomainHelperForSpecs.ConstantParameterWithValue(0).WithName(CoreConstants.Parameters.HALF_LIFE_INTESTINE);

            _parameters.AddRange(new[]
                                 { _halfLifeLiverParameter, _halfLifeLiverIntestineParameter, _referenceConcentrationParam, relExp1Param, relExp2Param });
        }
Exemplo n.º 16
0
    public override void ReInit(Patient patient)
    {
        base.ReInit(patient);

        Transform[] childs = rengenParent.transform.GetComponentsInChildren <Transform>();
        for (byte i = 1; i < childs.Length; ++i)
        {
            Destroy(childs[i].gameObject);
        }

        organPosHolder = Instantiate(patient.ui.rengenPrefab, rengenParent.transform).GetComponent <OrganPosHolder>();

        organs = new Organ[organPosHolder.organPos.Length];
        for (byte i = 0; i < patient.organs.Length; ++i)
        {
            if (patient.organs[i] != null)
            {
                Organ organ = Instantiate(patient.organs[i], organPosHolder.organPos[i]);
                organ.name = patient.organs[i].name;
                organ.SetRaycastTarget(false);
                organPosHolder.onClickAction[i] += ProcessClickOnRengen;

                organs[i] = organ;
            }
            else
            {
                organPosHolder.onClickAction[i] += ProcessClickOnRengen;
                organs[i] = null;
            }
        }
    }
Exemplo n.º 17
0
        public void BasedBodyPart(ObjectList GameObjectBody)
        {
            if (GameObjectBody == null)
            {
                return;
            }

            if (GameObjectBody.Elements.Count == 0)
            {
                return;
            }

            foreach (var Organ in GameObjectBody.Elements)
            {
                var bodyPart = Organ.GetComponent <BodyPart>();
                SetUpBodyPart(bodyPart);
            }


            // var DownOrgans = GameObjectBody.GetComponent<RootBodyPartContainer>();
            // if (DownOrgans != null)
            // {
            // if (DownOrgans.OptionalOrgans.Count > 0)
            // {
            // var Option = Instantiate(AdditionalOrgan, ScrollListBody.transform);
            // Option.SetUp(this, DownOrgans, "");
            // OpenBodyCustomisation[GameObjectBody.name] = Option;
            // }
            // }
        }
Exemplo n.º 18
0
        public void Delete(Organ o)
        {
            var _context = new DataContext();

            _context.Organs.Remove(o);
            _context.SaveChanges();
        }
Exemplo n.º 19
0
    private void Update()
    {
        foreach (Organ1 Organ in Organ1s)
        {
            Organ.Update();
        }

        // now update new canopy covers
        PlantSpatial.Density     = Population.Density;
        PlantSpatial.CanopyWidth = Stem.Width;

        foreach (Organ1 Organ in Organ1s)
        {
            Organ.DoCover();
        }

        // Update the plant stress observers
        SWStress.Update();
        NStress.Update();
        Population.Update();

        UpdateCanopy();

        foreach (Organ1 Organ in Organ1s)
        {
            Organ.DoNConccentrationLimits();
        }

        // PUBLISH BiomassRemoved event
        DoBiomassRemoved();
    }
Exemplo n.º 20
0
    private bool RemoveOrganMedium()
    {
        Organ organ = RandomOrgan();

        // int n = 0;
        // bool x = false;
        // //x = x || (organ is Heart && !unlockTracker.charms_heart);
        // //x = x || (organ is Lung && !unlockTracker.charms_lung);
        // //x = x || (organ is Brain && !unlockTracker.charms_lung && !unlockTracker.charms_heart);
        // while (x && n < 5)
        // {
        //     organ = RandomOrgan();
        //     x = false;
        //     //x = x || (organ is Heart && !unlockTracker.charms_heart);
        //     //x = x || (organ is Lung && !unlockTracker.charms_lung);
        //     //x = x || (organ is Brain && !unlockTracker.charms_lung && !unlockTracker.charms_heart);
        //     n += 1;
        // }
        // if (n > 5)
        // {
        //     return false;
        // }

        if (organ.connectedBodyParts.Count() > 0 && !(organ is Brain))
        {
            Debug.Log($"{organ.name} external");
            textLog.NewLogEntry($"The {organ.name} requires re-implanting.");

            Actions_Surgery.RemoveOrganProcess(organ);
            return(true);
        }

        return(false);
    }
Exemplo n.º 21
0
    public bool GoToNextTurn()
    {
        bool res = LaunchAttack();

        if (res)
        {
            LaunchReward();
            LaunchPreparation();
            OrganSettlementManager MyMan      = gameObject.GetComponent <OrganSettlementManager>();
            List <GameObject>      Obj2Unlist = new List <GameObject>();
            foreach (GameObject orgObj in MyMan.GetInstantiatedOrgans())
            {
                Organ org = orgObj.GetComponent <Organ>();
                org.OnGoToNextTurn();
            }
            foreach (MainOrgan mOrg in organContainer.GetComponentsInChildren <MainOrgan>())
            {
                mOrg.OnGoToNextTurn();
            }
            UpdateSimulation();
            DebugDisplay();
            Debug.Log("tour " + roundCount);
        }
        defOnTurn = 0;
        return(res);
    }
Exemplo n.º 22
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Organ model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Organ set ");
            strSql.Append("OrganName=@OrganName,");
            strSql.Append("Remark=@Remark,");
            strSql.Append("Superior=@Superior,");
            strSql.Append("Level=@Level");
            strSql.Append(" where OrganID=@OrganID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@OrganName", model.OrganName),
                new SqlParameter("@Remark",    model.Remark == null ? "" : model.Remark),
                new SqlParameter("@Superior",  model.Superior == null ? 0 : model.Superior),
                new SqlParameter("@Level",     model.Level),
                new SqlParameter("@OrganID",   model.OrganID)
            };

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 23
0
        /// <summary>
        /// Takes an organ and returns the string representation
        /// </summary>
        public static string ToString(Organ organ)
        {
            switch (organ)
            {
            case Organ.KIDNEY: return("Kidney");

            case Organ.BONE: return("Bone Marrow");

            case Organ.CORNEA: return("Cornea");

            case Organ.EAR: return("Middle Ear");

            case Organ.HEART: return("Heart");

            case Organ.PANCREAS: return("Pancreas");

            case Organ.INTESTINE: return("Intestine");

            case Organ.SKIN: return("Skin");

            case Organ.TISSUE: return("Connective Tissue");

            case Organ.LUNG: return("Lung");

            case Organ.LIVER: return("Liver");

            default: throw new ArgumentException("Invalid organ");
            }
        }
Exemplo n.º 24
0
    private void ResetTurnFunction()
    {
        ResetSimulation();
        OrganSettlementManager MyMan      = gameObject.GetComponent <OrganSettlementManager>();
        List <GameObject>      Obj2Unlist = new List <GameObject>();

        foreach (GameObject orgObj in MyMan.GetInstantiatedOrgans())
        {
            Organ org = orgObj.GetComponent <Organ>();
            org.OnResetTurn();
            if (org.GetBuildTurn() == roundCount)
            {
                Refund(org.resourcesType);
                LineDrawer.ClearOrganRelations(org.GetBuildTurn());
                Obj2Unlist.Add(orgObj);
                Destroy(orgObj);
            }
            else
            {
                org.OnSimulateReward();
            }
        }
        foreach (GameObject orgObj in Obj2Unlist)
        {
            MyMan.GetInstantiatedOrgans().Remove(orgObj);
        }
        MyMan.OnResetTurn();
    }
Exemplo n.º 25
0
        public void Update(Organ o)
        {
            var _context = new ApplicationDbContext();

            _context.Entry(o).State = EntityState.Modified;
            _context.SaveChanges();
        }
Exemplo n.º 26
0
 public void doEmotions(Organ organs, int act)
 {
     Color[] colors = this.beginEmotions();
     doPowder(colors, organs.background, organs.min, organs.max);
     doPowder(colors, organs.action[act], organs.min, organs.max);
     this.endEmotions(colors);
 }
Exemplo n.º 27
0
        public async Task <IActionResult> PutOrgan(int id, Organ organ)
        {
            if (id != organ.ID)
            {
                return(BadRequest());
            }

            _context.Entry(organ).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!OrganExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemplo n.º 28
0
    private void ShowOrganSettlementIcons(Vector3 mouseWorldPosition)
    {
        GameObject[] unlockedOrganPrefabs = GetUnlockedOrganPrefabs();
        iconMap.Clear();
        float startAngle = Mathf.PI;
        float stepAngle  = Mathf.PI / 4f;
        float radius     = 1.5f;

        for (int i = 0; i < unlockedOrganPrefabs.Length; i++)
        {
            Organ organ = unlockedOrganPrefabs[i].GetComponent <Organ>();
            //float angle = i * (2 * Mathf.PI / unlockedOrganPrefabs.Length);
            float      angle = startAngle - (i * stepAngle);
            GameObject icon  = Instantiate <GameObject>(iconPrefab);
            icon.transform.SetParent(canvas.transform, false);
            icon.GetComponent <Image>().sprite = organ.hudImage;
            icon.GetComponent <OrganSettlementIcon>().UpdateSprites(organ.hudImage, organ.hudImageSelected, organ.hudImageWrong);
            RectTransform rectTransform = (RectTransform)icon.transform;
            rectTransform.position    = new Vector3(mouseWorldPosition.x, 0.1f, mouseWorldPosition.z);
            rectTransform.eulerAngles = new Vector3(90f, 0, 0);
            rectTransform.localScale  = new Vector2(0, 0);
            growIconCoroutine         = StartCoroutine(GrowIconCoroutine(rectTransform, mouseWorldPosition, angle, radius));
            iconMap.Add(icon.GetComponent <OrganSettlementIcon>(), organ);
        }
    }
Exemplo n.º 29
0
        private void calculateMatch(Organ r)
        {
            // This will query the recipient wait list with information from the added organ r.
            // Next it will extract the top recipient from the wait list.
            // It will then add the recipient to the match table, intiating the trigger which will prompt the owner if they want to accept the organ.
            // FUTURE: Deal with cases where there is no need for the organ.

            RecipientWaitList waitList = new RecipientWaitList();
            int userID = r.MedicalPersonnelID;

            Medical_Personnel m = (from Medical_Personnel in OrganDonorSystemDB.Medical_Personnel
                                   where Medical_Personnel.medicalPersonnelId == userID
                                   select Medical_Personnel).Single();

            waitList.populateList(r.organType_organtypeID, r.BloodType_BloodTypeID, m.State, m.City);
            if (waitList.getList().Count() > 0)
            {
                Recipient reciever = waitList.getList()[0];

                MatchTable newEntry = new MatchTable();
                newEntry.acceptedOrDeclined             = null;
                newEntry.medicalPersonnelIdForRecipient = reciever.medicalPersonnelID;
                newEntry.organID     = r.OrganID;
                newEntry.organType   = r.organType_organtypeID;
                newEntry.recipientID = reciever.recipentID;


                OrganDonorSystemDB.AddToMatchTables(newEntry);
                OrganDonorSystemDB.SaveChanges();
            }
        }
Exemplo n.º 30
0
        /// <summary>Derives seneseced plant nitrogen (g N/m^2)</summary>
        /// <param name="Organs">The organs.</param>
        internal void doNSenescedRetranslocation(List <Organ1> Organs)
        {
            //! now get N to retranslocate out of senescing leaves
            foreach (Organ1 Organ in Organs)
            {
                Organ.ZeroDltNSenescedTrans();
            }

            double dlt_n_in_senescing_leaf = Leaf.Senescing.Wt * Leaf.Live.NConc;

            double n_demand_tot = 0;

            foreach (Organ1 Organ in Organs)
            {
                n_demand_tot += Organ.NDemand;
            }

            double navail = dlt_n_in_senescing_leaf - Leaf.Senescing.N;

            navail = MathUtilities.Constrain(navail, 0.0, n_demand_tot);

            foreach (Organ1 Organ in Organs)
            {
                Organ.DoNSenescedRetranslocation(navail, n_demand_tot);
            }
        }
Exemplo n.º 31
0
    public void SwitchOrgan(Organ organA, Organ organB)
    {
        int indexOfA = GetIndexOfOrgan(organA);
        int indexOfB = GetIndexOfOrgan(organB);

        Vector3 temp = _organs[indexOfA].transform.localPosition;
        _organs[indexOfA].transform.localPosition = _organs[indexOfB].transform.localPosition;
        _organs[indexOfB].transform.localPosition = temp;

        Organ tempOrgin = _organs[indexOfA];
        _organs[indexOfA] = _organs[indexOfB];
        _organs[indexOfB] = tempOrgin;
    }
Exemplo n.º 32
0
 public int GetIndexOfOrgan(Organ organ)
 {
     int index = -1;
     for (int i = 0; i < _organs.Length; ++i)
     {
         if (_organs[i] == organ)
         {
             index = i;
             break;
         }
     }
     return index;
 }
Exemplo n.º 33
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     Organ organ = new Organ();
     organ.OrganID = int.Parse(txt_ID.Text.Trim());
     organ.OrganName = txt_Name.Text.Trim();
     organ.Remark = txt_Remark.Text.Trim();
     organ.Superior = Convert.ToInt32(ddl_Superior.SelectedValue);
     organ.Level = Convert.ToInt32(ddl_Level.SelectedValue);
     bool re = organBLL.Update(organ);
     if (re)
     {
         UtilityService.Alert(this.Page, "修改成功!");
         Response.Redirect("OrganMgr.aspx");
     }
     else
     {
         UtilityService.Alert(this.Page, "修改失败!");
     }
     ;
 }
Exemplo n.º 34
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        Organ organ = new Organ();
        //organ.OrganID = int.Parse(txt_ID.Text.Trim());
        organ.OrganName = txt_Name.Text.Trim();
        organ.Superior = Convert.ToInt32(ddl_Superior.SelectedValue);
        organ.Level = int.Parse(ddl_Level.SelectedValue.ToString());
        organ.Remark = txt_Remark.Text;
        organ.InputBy = Session["UserID"].ToString();

        bool re = organBLL.Add(organ);
        if (re)
        {
            Response.Write("添加成功!");
            Response.Redirect("OrganMgr.aspx");
        }
        else
        {
            Response.Write("添加失败!");
        }
    }
Exemplo n.º 35
0
 public void doEmotions(Organ organs, int act)
 {
     Color[] colors = this.beginEmotions ();
     doPowder (colors, organs.background, organs.min, organs.max);
     doPowder (colors, organs.action[act],organs.min, organs.max);
     this.endEmotions (colors);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="OperationData"/> class.
 /// </summary>
 /// <param name="operationId">The operation id.</param>
 /// <param name="date">The date.</param>
 /// <param name="team">The team.</param>
 /// <param name="process">The process.</param>
 /// <param name="diagnoses">The diagnoses.</param>
 /// <param name="performed">The performed.</param>
 /// <param name="patientId">The patient id.</param>
 /// <param name="additionalinformation">The additionalinformation.</param>
 /// <param name="medication">The medication.</param>
 /// <param name="intdiagnoses">The intdiagnoses.</param>
 /// <param name="ppps">The PPPS.</param>
 /// <param name="result">The result.</param>
 /// <param name="kathDays">Kathetar Days.</param>
 /// <param name="organ">Organ.</param>
 /// <param name="opResult">opResult.</param>
 public OperationData(long operationId, DateTime date, string team, string process,
     string diagnoses, string performed, long patientId,
     string additionalinformation, string medication, long intdiagnoses,
     PPPS ppps, Result result, long kathDays, Organ organ, string opResult)
 {
     this.operationId = operationId;
     this.date = date;
     this.team = team;
     this.process = process;
     this.diagnoses = diagnoses;
     this.performed = performed;
     this.patientId = patientId;
     this.additionalinformation = additionalinformation;
     this.medication = medication;
     this.intdiagnoses = intdiagnoses;
     this.ppps = ppps;
     this.result = result;
     this.kathDays = kathDays;
     this.organ = organ;
     this.opResult = opResult;
 }
Exemplo n.º 37
0
    private void BindOrgan()
    {
        IList<Organ> ds = new OrganBLL().GetModelList("");
        Organ o = new Organ();
        o.OrganID = 100;
        o.OrganName = "超级管理员";
        ds.Add(o);

        //ddl_Superior.DataSource = ds;
        //ddl_Superior.DataTextField = "OrganName";
        //ddl_Superior.DataValueField = "OrganID";
        //ddl_Superior.DataBind();
    }
Exemplo n.º 38
0
 public void doEmotions(Color[] colors, Organ organs, int act)
 {
     doPowder (colors, organs.background, organs.min, organs.max);
     doPowder (colors, organs.action[act], organs.min, organs.max);
 }