Пример #1
0
        public void InitSimulationGrid(Sim.machineMap machines)
        {
            ClearAndDeselectAllItems();
            ClearGrid();

            if (machines == null || machines.map == null)
            {
                return;
            }
            foreach (Sim.machineMapEntry machine in machines.map)
            {
                string       instanceID = machine.key;
                int          classID    = HelperFunctions.GetClassIdFromItemId(instanceID);
                Sim.position pos        = machine.value;
                Point3D      point      = TransformServerToClientCoords(new Point3D(pos.x, pos.y, 0));
                GridItem3D   newItem    = CreateGridItem3D(classID, point, pos.direction.ToString());

                newItem.instanceId = instanceID;
                PlaceItem(newItem);
            }
            SetItemOffset();
        }
 private void updateUIAfterLoadingSimulation(int height, int width, SimulationServiceReference.machineMap simulation)
 {
     ResizeGrid(height, width);
     grid.InitSimulationGrid(simulation);
     Show3DGrid();
 }