public void FromItem(AGSSerializationContext context, IAnimationContainer item)
        {
            Animation = context.GetContract(item.Animation);
            Border    = context.GetContract(item.Border);

            DebugDrawAnchor = item.DebugDrawAnchor;
        }
 public void FromItem(AGSSerializationContext context, IDisplayListSettings item)
 {
     DisplayRoom     = item.DisplayRoom;
     DisplayGUIs     = item.DisplayGUIs;
     DepthClipping   = context.GetContract(item.DepthClipping);
     RestrictionList = context.GetContract(item.RestrictionList);
 }
Пример #3
0
        public void FromItem(AGSSerializationContext context, IGameState item)
        {
            UI = new List <IContract <IObject> > (item.UI.Count);
            foreach (var ui in item.UI)
            {
                var contract = context.GetContract(ui);
                if (contract == null)
                {
                    continue;
                }
                UI.Add(contract);
            }

            Rooms = new List <IContract <IRoom> > (item.Rooms.Count);
            foreach (var room in item.Rooms)
            {
                Rooms.Add(context.GetContract(room));
            }

            Player = new ContractCharacter();
            Player.FromItem(context, item.Player);

            GlobalVariables = context.GetContract(item.GlobalVariables);
            Cutscene        = context.GetContract(item.Cutscene);
            RepeatCounters  = Repeat.ToDictionary();
            GameSpeed       = item.Speed;
        }
Пример #4
0
        public void FromItem(AGSSerializationContext context, IRoom item)
        {
            ID         = item.ID;
            ShowPlayer = item.ShowPlayer;

            Background = context.GetContract(item.Background);

            Objects = new List <IContract <IObject> > (item.Objects.Count);

            foreach (var obj in item.Objects)
            {
                Objects.Add(context.GetContract(obj));
            }

            Properties = context.GetContract(item.Properties);

            Areas = new List <IContract <IArea> > (item.Areas.Count);
            foreach (var area in item.Areas)
            {
                Areas.Add(context.GetContract(area));
            }

            Edges           = context.GetContract((IAGSEdges)item.Edges);
            BackgroundColor = item.BackgroundColor?.Value;
        }
Пример #5
0
 public void FromItem(AGSSerializationContext context, ButtonAnimation item)
 {
     Animation  = context.GetContract(item.Animation);
     Border     = context.GetContract(item.Border);
     TextConfig = context.GetContract(item.TextConfig);
     Tint       = item.Tint == null ? (uint?)null : item.Tint.Value.Value;
 }
Пример #6
0
        public void FromItem(AGSSerializationContext context, IAnimationComponent item)
        {
            Animation = context.GetContract(item.Animation);
            Border    = context.GetContract(item.Border);

            DebugDrawPivot = item.DebugDrawPivot;
        }
Пример #7
0
 public void FromItem(AGSSerializationContext context, IImageComponent item)
 {
     SpriteProvider = context.GetContract(item.SpriteProvider);
     Border         = context.GetContract(item.Border);
     DebugDrawPivot = item.DebugDrawPivot;
     Image          = context.GetContract(item.Image);
 }
Пример #8
0
 public void FromItem(AGSSerializationContext context, IInventoryItem item)
 {
     Graphics       = context.GetContract(item.Graphics);
     CursorGraphics = context.GetContract(item.CursorGraphics);
     Qty            = item.Qty;
     ShouldInteract = item.ShouldInteract;
 }
Пример #9
0
        public void FromItem(AGSSerializationContext context, IAnimation item)
        {
            Frames = new List <IContract <IAnimationFrame> > (item.Frames.Count);
            foreach (var frame in item.Frames)
            {
                Frames.Add(context.GetContract(frame));
            }

            Configuration = context.GetContract(item.Configuration);
            State         = context.GetContract(item.State);
        }
Пример #10
0
        public void FromItem(AGSSerializationContext context, IObject item)
        {
            IButton button = (IButton)item;

            Object = new ContractObject();
            Object.FromItem(context, button);

            TextComponent = new ContractTextComponent();
            TextComponent.FromItem(context, button);

            IdleAnimation   = context.GetContract(button.IdleAnimation);
            HoverAnimation  = context.GetContract(button.HoverAnimation);
            PushedAnimation = context.GetContract(button.PushedAnimation);
        }
Пример #11
0
 public void FromItem(AGSSerializationContext context, IBrush item)
 {
     Type                = item.Type;
     MainColor           = item.Color.Value;
     Blend               = context.GetContract(item.Blend);
     GammaCorrection     = item.GammaCorrection;
     InterpolationColors = context.GetContract(item.InterpolationColors);
     LinearColors        = item.LinearColors == null ? null : item.LinearColors.Select(c => c.Value).ToArray();
     Transform           = context.GetContract(item.Transform);
     WrapMode            = item.WrapMode;
     BackgroundColor     = item.BackgroundColor.Value;
     HatchStyle          = item.HatchStyle;
     CenterPoint         = context.GetContract(item.CenterPoint);
     FocusScales         = context.GetContract(item.FocusScales);
 }
Пример #12
0
 public void FromItem(AGSSerializationContext context, ITextConfig item)
 {
     Brush         = context.GetContract(item.Brush);
     Font          = context.GetContract(item.Font);
     OutlineBrush  = context.GetContract(item.OutlineBrush);
     OutlineWidth  = item.OutlineWidth;
     ShadowBrush   = context.GetContract(item.ShadowBrush);
     ShadowOffsetX = item.ShadowOffsetX;
     ShadowOffsetY = item.ShadowOffsetY;
     Alignment     = item.Alignment;
     AutoFit       = item.AutoFit;
     PaddingLeft   = item.PaddingLeft;
     PaddingRight  = item.PaddingRight;
     PaddingTop    = item.PaddingTop;
     PaddingBottom = item.PaddingBottom;
 }
Пример #13
0
 public void FromItem(AGSSerializationContext context, IImage image)
 {
     ID         = image.ID;
     Width      = image.Width;
     Height     = image.Height;
     LoadConfig = context.GetContract(image.LoadConfig);
 }
Пример #14
0
 public void FromItem(AGSSerializationContext context, ITextComponent item)
 {
     TextConfig = context.GetContract(item.TextConfig);
     Text       = item.Text;
     Width      = item.LabelRenderSize.Width;
     Height     = item.LabelRenderSize.Height;
 }
Пример #15
0
        public void FromItem(AGSSerializationContext context, ILabel item)
        {
            Object = new ContractObject();
            Object.FromItem(context, (IObject)item);

            TextComponent = context.GetContract(item as ITextComponent);
        }
Пример #16
0
        public void FromItem(AGSSerializationContext context, IViewport item)
        {
            Camera = new Contract <ICamera> ();
            Camera.FromItem(context, item.Camera);

            X                       = item.X;
            Y                       = item.Y;
            ScaleX                  = item.ScaleX;
            ScaleY                  = item.ScaleY;
            ProjectionBox           = context.GetContract(item.ProjectionBox);
            DisplayListSettings     = context.GetContract(item.DisplayListSettings);
            IsRoomProviderGameState = item.RoomProvider == context.Resolver.Container.Resolve <IGameState>();
            if (!IsRoomProviderGameState)
            {
                RoomProviderRoomID = item.RoomProvider.Room.ID;
            }
        }
Пример #17
0
 public void FromItem(AGSSerializationContext context, IClippingPlane item)
 {
     IsPlaneObjectClipped = item.IsPlaneObjectClipped;
     PlaneObject          = context.GetContract(item.PlaneObject);
     if (item.LayersToClip != null)
     {
         LayersToClip = new List <IContract <IRenderLayer> >(item.LayersToClip.Select(i => context.GetContract(i)).ToList());
     }
 }
Пример #18
0
        public void FromItem(AGSSerializationContext context, IObject item)
        {
            ID          = item.ID;
            RenderLayer = context.GetContract(item.RenderLayer);

            Properties = context.GetContract(item.Properties);

            AnimationComponent = new ContractAnimationComponent();
            AnimationComponent.FromItem(context, item);

            if (item.WalkPoint != null)
            {
                WalkPoint = new Tuple <float, float> (item.WalkPoint.Value.X, item.WalkPoint.Value.Y);
            }
            Enabled           = item.UnderlyingEnabled;
            Visible           = item.UnderlyingVisible;
            Hotspot           = item.Hotspot;
            IgnoreViewport    = item.IgnoreViewport;
            IgnoreScalingArea = item.IgnoreScalingArea;
            if (Parent == null && item.TreeNode != null && item.TreeNode.Parent != null)
            {
                Parent = context.GetContract(item.TreeNode.Parent);
            }
            if (item.Width != 0f)
            {
                var scaleX = item.ScaleX;
                var scaleY = item.ScaleY;
                item.ResetScale();
                InitialWidth  = item.Width;
                InitialHeight = item.Height;
                item.Scale    = new PointF(scaleX, scaleY);
            }
            Image = new Contract <IImage>();
            Image.FromItem(context, item.Image);
            Pivot          = new Tuple <float, float>(item.Pivot.X, item.Pivot.Y);
            Tint           = item.Tint.Value;
            Angle          = item.Angle;
            ScaleX         = item.ScaleX;
            ScaleY         = item.ScaleY;
            IsPixelPerfect = item.PixelPerfectHitTestArea != null;
            Location       = new Tuple <float, float, float>(item.X, item.Y, item.Z);
            CustomRenderer = item.CustomRenderer == null ? null : item.CustomRenderer.GetType().Name;
        }
        public void FromItem(AGSSerializationContext context, IInventoryWindow item)
        {
            Object = new ContractObject();
            Object.FromItem(context, item);

            Inventory = item.Inventory == null ? null : context.GetContract(item.Inventory);

            ItemWidth  = item.ItemSize.Width;
            ItemHeight = item.ItemSize.Height;
        }
Пример #20
0
        public void FromItem(AGSSerializationContext context, IObject item)
        {
            ID          = item.ID;
            RenderLayer = context.GetContract(item.RenderLayer);

            Properties = context.GetContract(item.Properties);

            AnimationComponent = new ContractAnimationComponent();
            AnimationComponent.FromItem(context, item);

            Enabled           = item.UnderlyingEnabled;
            Visible           = item.UnderlyingVisible;
            DisplayName       = item.DisplayName;
            IgnoreViewport    = item.IgnoreViewport;
            IgnoreScalingArea = item.IgnoreScalingArea;
            if (Parent == null && item.TreeNode != null && item.TreeNode.Parent != null)
            {
                Parent = context.GetContract(item.TreeNode.Parent);
            }
            // ReSharper disable once CompareOfFloatsByEqualityOperator
            if (item.Width != 0f)
            {
                var scaleX = item.ScaleX;
                var scaleY = item.ScaleY;
                item.ResetScale();
                InitialWidth  = item.Width;
                InitialHeight = item.Height;
                item.Scale    = new PointF(scaleX, scaleY);
            }
            Image = new Contract <IImage>();
            Image.FromItem(context, item.Image);
            Pivot          = new Tuple <float, float>(item.Pivot.X, item.Pivot.Y);
            Tint           = item.Tint.Value;
            Angle          = item.Angle;
            ScaleX         = item.ScaleX;
            ScaleY         = item.ScaleY;
            IsPixelPerfect = item.IsPixelPerfect;
            Position       = new Tuple <float, float, float>(item.X, item.Y, item.Z);
        }
Пример #21
0
        public void FromItem(AGSSerializationContext context, ICharacter item)
        {
            if (item == null)
            {
                return;
            }
            WalkSpeed = item.WalkStep;
            AdjustWalkSpeedToScaleArea = item.AdjustWalkSpeedToScaleArea;
            DebugDrawWalkPath          = item.DebugDrawWalkPath;

            Outfit = context.GetContract(item.Outfit);

            Obj = new ContractObject();
            Obj.FromItem(context, item);

            Inventory = context.GetContract(item.Inventory);

            if (context.Player == item)
            {
                IsPlayer = true;
            }
        }
Пример #22
0
 public void FromItem(AGSSerializationContext context, IDepthClipping item)
 {
     NearClippingPlane = context.GetContract(item.NearClippingPlane);
     FarClippingPlane  = context.GetContract(item.FarClippingPlane);
 }
Пример #23
0
 public void FromItem(AGSSerializationContext context, IImageComponent item)
 {
     SpriteProvider = context.GetContract(item.SpriteProvider);
     Image          = context.GetContract(item.Image);
 }
 public void FromItem(AGSSerializationContext context, IAnimationComponent item)
 {
     Animation = context.GetContract(item.Animation);
 }