private void OnEntrySelected(Data.Child Entry)
 {
     if (EntrySelected != null)
     {
         EntrySelected(Entry);
     }
 }
Beispiel #2
0
        static internal async Task LoadState()
        {
            //Try catch inside of the Method
            SingleParam <SuspensionState> res = await new Persistance().LoadJsonAsync <SuspensionState>(SuspensionStateFileNameWithExt);

            if (res.Success == true)
            {
                PointerTo_ListOfEntries = res.value.Entries;
                PointerTo_SelectedEntry = res.value.SelectedEntry;
            }
        }
        internal Data.Child ToBlueprintData()
        {
            bool isPart = shape is Part;

            Data.Child child = new Data.Child()
            {
                Color      = this.GetColorStr(),
                ShapeId    = isPart ? (shape as Part).partData.Uuid : (shape as Block).blockData.Uuid,
                Controller = this.Controller,
                Joints     = connectedJoints?.Select(
                    joint => new JointReference()
                {
                    Id = joint.Id
                }).ToList()
            };

            {
                (int x, int y, int z) = this.GetBlueprintPosition();
                child.Pos             = new Data.Pos()
                {
                    X = x, Y = y, Z = z
                };

                (int xaxis, int zaxis) = this.GetBlueprintRotation();
                child.Xaxis            = xaxis;
                child.Zaxis            = zaxis;
            }

            if (!isPart)
            {
                (int x, int y, int z) = this.GetBounds();
                child.Bounds          = new Data.Bounds()
                {
                    X = x, Y = y, Z = z
                };
            }

            return(child);
        }