Exemplo n.º 1
0
        public static CoalescedObjectSnapshot FromCoalescedObject(CoalescedObject csog, SerializationFlags flags)
        {
            List <Tuple <SceneObjectGroupSnapshot, ItemPermissionBlockSnapshot> > snapGroups
                = new List <Tuple <SceneObjectGroupSnapshot, ItemPermissionBlockSnapshot> >();

            foreach (var group in csog.Groups)
            {
                snapGroups.Add(
                    new Tuple <SceneObjectGroupSnapshot, ItemPermissionBlockSnapshot>(
                        SceneObjectGroupSnapshot.FromSceneObjectGroup(group, flags),
                        ItemPermissionBlockSnapshot.FromItemPermissionBlock(csog.FindPermissions(group.UUID)))
                    );
            }

            return(new CoalescedObjectSnapshot {
                GroupsWithPermissions = snapGroups.ToArray()
            });
        }
Exemplo n.º 2
0
        public static CoalescedObjectSnapshot FromGroups(IEnumerable <Tuple <SceneObjectGroup, ItemPermissionBlock> > groups, SerializationFlags flags)
        {
            List <Tuple <SceneObjectGroupSnapshot, ItemPermissionBlockSnapshot> > snapGroups
                = new List <Tuple <SceneObjectGroupSnapshot, ItemPermissionBlockSnapshot> >();

            foreach (var group in groups)
            {
                snapGroups.Add(
                    new Tuple <SceneObjectGroupSnapshot, ItemPermissionBlockSnapshot>(
                        SceneObjectGroupSnapshot.FromSceneObjectGroup(group.Item1, flags),
                        ItemPermissionBlockSnapshot.FromItemPermissionBlock(group.Item2))
                    );
            }

            return(new CoalescedObjectSnapshot {
                GroupsWithPermissions = snapGroups.ToArray()
            });
        }