示例#1
0
        public LivingRoom Delete([FromBody] LivingRoom livingRoom)
        {
            _context.LivingRooms.Remove(livingRoom);
            _context.SaveChanges();

            return(livingRoom);
        }
示例#2
0
        public LivingRoom Post([FromBody] LivingRoom livingRoom)
        {
            _context.LivingRooms.Add(livingRoom);
            _context.SaveChanges();

            return(livingRoom);
        }
示例#3
0
        public LivingRoom Put([FromBody] LivingRoom livingRoom)
        {
            _context.Entry <LivingRoom>(livingRoom).State = EntityState.Modified;
            _context.SaveChanges();

            return(livingRoom);
        }
示例#4
0
 public GoCommand(Kitchen kitchen, LivingRoom livingRoom)
 {
     _roomsMap = new Dictionary <string, IArea>
     {
         { kitchen.GetName().ToLower(), kitchen },
         { livingRoom.GetName().ToLower(), livingRoom }
     };
 }
示例#5
0
        public void Should_Construct_Living_Room()
        {
            var room     = new LivingRoom();
            var elements = new List <Element>()
            {
                new Television(), new Kitchen(), new Chair()
            };

            Assert.IsTrue(room.Elements.SequenceEqual(elements, new ElementEqualityComparer()));
        }
示例#6
0
    public static void Save(LivingRoom data, string filePath)
    {
        List <UnityEngine.Object> unityObjectReferences = new List <UnityEngine.Object>();

        unityObjectReferences.Add(new Mesh());
        unityObjectReferences.Add(new Material(Shader.Find("Standard")));

        byte[] bytes = SerializationUtility.SerializeValue(data, DataFormat.Binary, out unityObjectReferences);
        File.WriteAllBytes(filePath, bytes);
    }
示例#7
0
        public ActionResult Room_List_Student(int id = 0)
        {
            LivingRoom livingRoom = db.LivingRooms.Include(p => p.Students).Include(p => p.Employees).FirstOrDefault(s => s.Id == id);

            if (livingRoom == null)
            {
                return(HttpNotFound());
            }
            return(View(livingRoom));
        }
示例#8
0
 public void Visit(LivingRoom room)
 {
     return;
 }
示例#9
0
 public void Visit(LivingRoom room)
 {
     room.Clean();
 }
示例#10
0
    public void Load(string path)
    {
        LivingRoom loadedRoom = SaveSystem.Load(path);

        foreach (GameObjectInfo goi in loadedRoom.GetObjects())
        {
            GameObject g   = FindObject(sceneParent.gameObject, goi.name);
            Transform  obj = null;
            if (g != null)
            {
                obj = g.transform;
            }
            if (goi.name == "runtimeobject")
            {
                GameObject go = new GameObject("runtimeobject");
                go.AddComponent <MeshFilter>().mesh = goi.mesh.GetMesh();
                MeshRenderer meshRenderer = go.AddComponent <MeshRenderer>();
                meshRenderer.materials = new Material[goi.materials.Length];
                for (int j = 0; j < goi.materials.Length; j++)
                {
                    SerializableMaterial sMat = goi.materials[j];
                    Debug.Log(sMat.shaderName);
                    Material mat = meshRenderer.materials[j];
                    mat.shader = Shader.Find(sMat.shaderName);

                    for (int i = 0; i < sMat.propertyTextures.Count; i++)
                    {
                        byte[]  bytes;
                        Vector2 tiling, offset;
                        string  key = sMat.propertyTextures.ElementAt(i).Key;
                        sMat.propertyTextures.TryGetValue(key, out bytes);
                        sMat.propertyTiling.TryGetValue(key, out tiling);
                        sMat.propertyOffset.TryGetValue(key, out offset);

                        Texture2D texture2D = new Texture2D(2, 2);
                        texture2D.LoadImage(bytes);
                        texture2D.Apply();
                        mat.SetTexture(key, texture2D);

                        mat.SetTextureScale(key, tiling);
                        mat.SetTextureOffset(key, offset);
                    }

                    foreach (var property in sMat.propertyValues)
                    {
                        mat.SetFloat(property.Key, property.Value);
                    }

                    meshRenderer.materials[j] = mat;
                }

                go.transform.SetParent(sceneParent);
                obj = go.transform;
                go.AddComponent <MeshCollider>();
                go.AddComponent <MGS.ContextMenu.ContextMenuObjectExample>();
                go.tag = "Selectable";
                go.gameObject.layer = 9;
            }
            obj.position   = goi.position;
            obj.rotation   = goi.rotation;
            obj.localScale = goi.scale;
            obj.gameObject.SetActive(goi.isActive);
        }
    }
示例#11
0
 public void Visit(LivingRoom room)
 {
     // Does nothing here
 }