示例#1
0
        public Blueprint(Data.Cord worldstdloc, MyXmlWriter wirter, Dictionary <Space.RelationLevel, List <Space.RoomRelationShip> > rels)
        {
            this.WorldLocation = worldstdloc;

            Dictionary <Space.RelationLevel, List <Space.RoomRelationShip> > relations = new Dictionary <Space.RelationLevel, List <Space.RoomRelationShip> >();

            foreach (KeyValuePair <Space.RelationLevel, List <Space.RoomRelationShip> > entry in rels)
            {
                List <Space.RoomRelationShip> list = new List <Space.RoomRelationShip>();
                foreach (Space.RoomRelationShip rel in entry.Value)
                {
                    list.Add(rel);
                }
                relations.Add(entry.Key, list);
            }

            this.Relations = relations;
            this.Writer    = wirter;
        }
示例#2
0
        public void CreateXML(string path)
        {
            this.Writer = new MyXmlWriter(path);
            Writer.StartToWrite();
            int cameraNumber = 1;

            foreach (List <Space.RoomRelationShip> relations in this.Relations.Values)
            {
                foreach (Space.RoomRelationShip rel in relations)
                {
                    //Side가 모두 계산된 후에, 벽을 생성한다.
                    bool isFloor = true;
                    if (rel.Level == Space.RelationLevel.Second && rel.Origin is Space.Stair)
                    {
                        isFloor = false;
                    }

                    //지붕을 판단할 알고리즘이 필요하다.
                    bool isRoof = true;
                    if (rel.Level == Space.RelationLevel.First && rel.Origin is Space.Stair)
                    {
                        isRoof = false;
                    }

                    bool isStair = false;
                    if (rel.Level == Space.RelationLevel.First && rel.Origin is Space.Stair)
                    {
                        isStair = true;
                    }

                    rel.Origin.CreateComponents(isFloor, isRoof, cameraNumber++, isStair, rel.Level);
                    rel.Origin.WriteModel(Writer);
                }
            }
            Writer.EndToWrite();
        }