Exemplo n.º 1
0
 public TransformViewState(TransformOptions opts)
 {
     views = new Dictionary <ViewVersion, TransformViewOptions> {
         [ViewVersion.Round] = new RoundOptions(opts)
     };
     CurrentType = DEFAULT_TYPE;
 }
Exemplo n.º 2
0
 public View(string name, bool bigEndian = true) : base(name, "View", bigEndian)
 {
     _version   = ViewVersion.GH1;
     _views     = new List <string>();
     _bones     = new List <string>();
     _transform = null;
     _meshes    = new List <string>();
 }
Exemplo n.º 3
0
        public void SwitchType(ViewVersion type)
        {
            var newView = views[type];

            if (newView == null)
            {
                throw new ArgumentException(String.Format("Transformation {0} isn't implemented!", type));
            }

            CurrentType = type;
        }
Exemplo n.º 4
0
        private static bool IsVersionValid(ViewVersion version)
        {
            switch (version)
            {
            case ViewVersion.GH1:     // PS2 - GH1
                return(true);

            default:
                return(false);
            }
        }
Exemplo n.º 5
0
        public static RedirectToRouteResult RedirectToVersion(this Controller controller, string actionName, string controllerName)
        {
            if (controller == null)
            {
                throw new ArgumentNullException("controller");
            }

            ViewVersion          viewVersion  = controller.HttpContext.Request.IsMobile() ? ViewVersion.Mobile : ViewVersion.Full;
            RouteValueDictionary routeValues  = viewVersion == ViewVersion.Mobile ? new RouteValueDictionary(new { version = ViewVersion.Mobile }) : null;
            RouteValueDictionary routeValues1 = controller.RouteData == null
                                                    ? MergeRouteValues(actionName, controllerName, null, routeValues, true)
                                                    : MergeRouteValues(actionName, controllerName, controller.RouteData.Values, routeValues, true);

            return(new RedirectToRouteResult(routeValues1));
        }
Exemplo n.º 6
0
        private static bool DetermineEndianess(byte[] head, out ViewVersion version, out bool valid)
        {
            bool bigEndian = false;

            version = (ViewVersion)BitConverter.ToInt32(head, 0);
            valid   = IsVersionValid(version);

checkVersion:
            if (!valid && !bigEndian)
            {
                bigEndian = !bigEndian;
                Array.Reverse(head);
                version = (ViewVersion)BitConverter.ToInt32(head, 0);
                valid   = IsVersionValid(version);

                goto checkVersion;
            }

            return(bigEndian);
        }
Exemplo n.º 7
0
 public void SwitchView(ViewVersion type)
 {
     View.SwitchType(type);
     ViewChanged();
 }
Exemplo n.º 8
0
 public BoxItem(ViewVersion type, string name)
 {
     Type = type;
     Name = name;
 }