示例#1
0
        public static PlayerRoomLayout FromPlaceableObjects(List <PlaceableObject> placeableObjects)
        {
            List <CompoundRoomItem> list = new List <CompoundRoomItem>(placeableObjects.Count);

            while (placeableObjects.Count > 0)
            {
                PlaceableObject placeableObject = placeableObjects[0];
                placeableObjects.Remove(placeableObject);
                if (placeableObject.PieceNumber == 1)
                {
                    List <PlaceableObject> list2 = new List <PlaceableObject>();
                    list2.Add(placeableObject);
                    while (placeableObject.Next != null)
                    {
                        list2.Add(placeableObject.Next);
                        placeableObjects.Remove(placeableObject.Next);
                        placeableObject = placeableObject.Next;
                    }
                    list.Add(CompoundRoomItem.FromPlaceableObjects(list2));
                }
            }
            PlayerRoomLayout playerRoomLayout = new PlayerRoomLayout();

            playerRoomLayout._compoundRoomItems = list;
            return(playerRoomLayout);
        }
示例#2
0
 protected bool Equals(PlayerRoomLayout other)
 {
     return(object.Equals(_compoundRoomItems, other._compoundRoomItems));
 }