示例#1
0
        private void UpdateOwnUnitInformation(IEnumerable <JObject> units)
        {
            var ownUnitId = _registrationService.GetRegistrationInfo()?.Id;

            if (ownUnitId != null)
            {
                var ownUnit = units.FirstOrDefault(unit =>
                                                   unit.Value <string>(GeobrokerConstants.UnitIdProperty) == ownUnitId);
                var ownUnitInformation = new UnitInformation(ownUnitId,
                                                             ownUnit?.Value <string>(GeobrokerConstants.UnitNameProperty));
                _registrationService.RegisteredUnitInformation = ownUnitInformation;
            }
        }
示例#2
0
    void Start () {
        // Set private
        toolTip = toolTipGO.GetComponent<ToolTipScript>();
        infoDisplay = infoDisplayGO.GetComponent<UnitInformation>();

        currentBuilding = 0;
        isInBuildMode = false;
        useToolTip = true;
        DeActivateToolTip();
        ChangePointer("Normal");
        HideUnitInformation();
        buildMenu.SetActive(false);
    }
示例#3
0
    private void OnUnitEntity(EntityAddedEvent evt)
    {
        UnitInfoModule uinfo   = evt.AddedXmasEntity.Module <UnitInfoModule>();
        GuiInformation guiinfo = this.GuiLoader.GetGuiInfo(uinfo.Controller);

        UnitEntity   unitEnt = (UnitEntity)evt.AddedXmasEntity;
        TilePosition posinfo = (TilePosition)evt.AddedPosition;


        Point     pos     = posinfo.Point;
        Transform unitobj = Factory.CreateUnit(unitEnt, posinfo);

        UnitInformation info = unitobj.gameObject.GetComponent <UnitInformation>();

        info.ControllerInfo = guiinfo;
    }
        protected override void Deserialize(string data, ref int index)
        {
            if (data.Length - index < 186)
            {
                throw new Exception("invalid data");
            }

            this.InstrumentId = Substring(data, ref index, 16);
            this.SequenceNo   = Substring(data, ref index, 10);
            Substring(data, ref index, 3);
            this.SampleId = Substring(data, ref index, 15);
            this.Date     = new DateTime(
                int.Parse(Substring(data, ref index, 4))
                , int.Parse(Substring(data, ref index, 2))
                , int.Parse(Substring(data, ref index, 2))
                , int.Parse(Substring(data, ref index, 2))
                , int.Parse(Substring(data, ref index, 2))
                , 0
                );

            Substring(data, ref index, 2);
            this.RackNo                     = Substring(data, ref index, 6);
            this.TubePosition               = Substring(data, ref index, 2);
            this.SampleNoAttr               = (SampleNoAttr)(int.Parse(Substring(data, ref index, 1)));
            this.AnalysisMode               = (AnalysisMode)(int.Parse(Substring(data, ref index, 1)));
            this.PatientId                  = Substring(data, ref index, 16);
            this.AnalysisInfoError          = (AnalysisInfoError)(int.Parse(Substring(data, ref index, 1)));
            this.SampleJudgmentInfo         = (SampleJudgmentInfo)(int.Parse(Substring(data, ref index, 1)));
            this.BloodCellDiffData          = (BloodCellDiffData)(int.Parse(Substring(data, ref index, 1)));
            this.BloodCellMorphologicalData = (BloodCellMorphologicalData)(int.Parse(Substring(data, ref index, 1)));
            this.BloodCellCountData         = (BloodCellCountData)(int.Parse(Substring(data, ref index, 1)));
            this.AnalysisError              = (AnalysisError)(int.Parse(Substring(data, ref index, 1)));
            this.AspirationRelatedError     = (AspirationRelatedError)(int.Parse(Substring(data, ref index, 1)));
            this.OrderInformation           = (OrderInformation)(int.Parse(Substring(data, ref index, 1)));

            this.IsWbcAbnormal = (int.Parse(Substring(data, ref index, 1)) == 1);
            this.IsWbcSuspect  = (int.Parse(Substring(data, ref index, 1)) == 1);
            this.IsRbcAbnormal = (int.Parse(Substring(data, ref index, 1)) == 1);
            this.IsRbcSuspect  = (int.Parse(Substring(data, ref index, 1)) == 1);
            this.IsPltAbnormal = (int.Parse(Substring(data, ref index, 1)) == 1);
            this.IsPltSuspect  = (int.Parse(Substring(data, ref index, 1)) == 1);

            this.UnitInformation = (UnitInformation)(int.Parse(Substring(data, ref index, 1)));
        }
示例#5
0
    // Use this for initialization
    void Start()
    {
        UnitInformation info = this.gameObject.GetComponent <UnitInformation>();

        entity    = info.Entity;
        graphics  = info.Graphics;
        direction = new Vector(entity.PositionAs <TilePosition>().Point, new Point(0, 0)).Direction;
        //this.gameObject.renderer.material.color = info.ControllerInfo.FocusColor;
        entity.Register(new Trigger <ActionHandShakeInqueryEvent <MoveAction> >(evt => evt.Action.HandShakeRequired = true));
        entity.Register(new Trigger <ActionStartingEvent <MoveAction> >(OnStartMoveAction));
        entity.Register(new Trigger <BeginMoveEvent>(OnUnitBeginMove));
        entity.Register(new Trigger <UnitTakesDamageEvent>(OnTakeDamage));
        entity.Register(new Trigger <ActionStartingEvent <MovePathAction> >(OnUnitBeginPathMove));
        entity.Register(new Trigger <ActionCompletedEvent <MovePathAction> >(OnUnitFinishPathMove));
        entity.Register(new Trigger <UnitDieEvent>(OnUnitDeath));
        this.HealthBar.GetComponent <HealthbarView>().SetHealthPct(this.entity.Module <HealthModule>().HealthPct);
        this.HealthBar.parent = this.transform;
        this.graphics.UseUnitAnimation(StandardUnitAnimations.Idle);
    }
示例#6
0
        public static Graph CalculateGraph(Map map, Unit unit, Point position)
        {
            UnitInformation unitinfo = new UnitInformation(unit.UnitType);

            Graph graph = new Graph();

            graph.Source = position.toString();

            graph.Vertices = new Dictionary <string, Dictionary <string, int> >();

            foreach (string vertex in map.navigationGraph.Vertices.Keys.ToList())
            {
                graph.Vertices.Add(vertex, new Dictionary <string, int>());
                foreach (string neighbor in map.navigationGraph.Vertices[vertex].Keys.ToList())
                {
                    Point   point   = neighbor.Parse();
                    MapCell mapcell = map[point];
                    int     cost    = Unit.GetTravelCost(unit.UnitType, map[point].terrain);

                    #region todo allow pathing into transport unit
                    ////check if point is blocked by an unit
                    //if (mapcell.unit != null)
                    //{
                    //    //check if airborne unit
                    //    if (mapcell.unit.UnitType.GetMovementType() != MovementType.Air)
                    //    {
                    //        //check if enemy unit
                    //        if (mapcell.unit.Owner != unit.Owner)
                    //        {
                    //            cost = int.MaxValue;
                    //        }
                    //        else
                    //        {
                    //            //check if transport unit
                    //            if (mapcell.unit.UnitType != UnitType.APC
                    //             && mapcell.unit.UnitType != UnitType.TransportCopter
                    //             && mapcell.unit.UnitType != UnitType.Lander
                    //             && mapcell.unit.UnitType != UnitType.Cruiser)
                    //            {
                    //                cost = int.MaxValue;
                    //            }
                    //        }
                    //    }
                    //}
                    #endregion

                    if (//check if there is a unit
                        map[point].unit != null
                        //check if that unit is an airborne unit
                        && map[point].unit.UnitType.GetMovementType() != MovementType.Air
                        //check if that unit is enemy
                        && map[point].unit.Owner != unit.Owner
                        )
                    {
                        cost = int.MaxValue;
                    }

                    if (cost < int.MaxValue)
                    {
                        graph.Vertices[vertex].Add(neighbor, cost);
                    }
                }
            }

            graph.Dijkstra(position.toString(), unitinfo.Move + 1);

            return(graph);
        }
 // Use this for initialization
 void Start()
 {
     UnitInformation info = this.gameObject.GetComponent <UnitInformation>();
 }
示例#8
0
 // Use this for initialization
 void Start()
 {
     unitInformation = new UnitInformation();
 }