Пример #1
0
 public Sprite(TextureLoader TextureLoader, string filename, Point pos, float d, Point spritesize, OriginType som)
 {
     DrawnPosition = pos;
     CurrentFrame  = 0;
     SpriteRect    = new Rectangle(CurrentFrame * SpriteSize.X, 0, SpriteSize.X, SpriteSize.Y);
     SpriteSize    = spritesize;
     rotation      = MathHelper.Pi * 0.0f;
     Depth         = d;
     Interval      = 190;
     if (filename != null)
     {
         Load(filename, TextureLoader);
     }
     originMode  = som;
     ReachedEnd  = false;
     GraphicsDir = filename;
     if (GraphicsDir != null)
     {
         for (int i = GraphicsDir.Length - 2; i > 0; i--)
         {
             var s = GraphicsDir.Substring(i, 2);
             if (s.Contains("\\"))
             {
                 GraphicsDir = GraphicsDir.Substring(0, i);
                 break;
             }
         }
     }
     if (SpriteSize == Point.Zero && SpriteSheet != null)
     {
         SpriteSize = new Point(SpriteSheet.Width, SpriteSheet.Height);
     }
     DrawnBounds = new Rectangle(DrawnPosition.X, DrawnPosition.Y, SpriteSize.X, SpriteSize.Y);
 }
Пример #2
0
 public Gladiator(byte years, OriginType origin)
 {
     Years        = years;
     this.origin  = origin;
     IsFreed      = false;
     this.isAlive = true;
 }
Пример #3
0
        public Instrument(XmlNode instrument)
        {
            this.id = XmlConvert.ToGuid(instrument.Attributes["ID"].Value);
            this.originCode = instrument.Attributes["OriginCode"].Value;
            this.code = instrument.Attributes["Code"].Value;
            this.numeratorUnit = XmlConvert.ToInt32(instrument.Attributes["NumeratorUnit"].Value);
            this.denominator = XmlConvert.ToInt32(instrument.Attributes["Denominator"].Value);
            this.isSinglePrice = XmlConvert.ToBoolean(instrument.Attributes["IsSinglePrice"].Value);
            this.originType = (OriginType)XmlConvert.ToByte(instrument.Attributes["OriginType"].Value);
            this.alertVariation = XmlConvert.ToInt32(instrument.Attributes["AlertVariation"].Value);
            this.normalWaitTime = XmlConvert.ToInt32(instrument.Attributes["NormalWaitTime"].Value);
            this.alertWaitTime = XmlConvert.ToInt32(instrument.Attributes["AlertWaitTime"].Value);
            this.isActive = XmlConvert.ToBoolean(instrument.Attributes["IsActive"].Value);

            this.originInactiveTime = XmlConvert.ToInt32(instrument.Attributes["OriginInactiveTime"].Value);
            this.isPriceEnabled = XmlConvert.ToBoolean(instrument.Attributes["IsPriceEnabled"].Value);
            this.isAutoEnablePrice = XmlConvert.ToBoolean(instrument.Attributes["IsAutoEnablePrice"].Value);
            if (instrument.Attributes["ExternalExchangeCode"] != null)
            {
                this.exchangeSystem = (ExchangeSystem)Enum.Parse(typeof(ExchangeSystem), instrument.Attributes["ExternalExchangeCode"].Value);
            }
            this.lastPriceEnabledTime = this.isPriceEnabled ? DateTime.Now : DateTime.MinValue;

            this.originQReceived = null;
            this.originQProcessed = null;
            this.quotePolicyDetails = new ArrayList();
            this.isTrading = false;
            this.scheduleID = null;
            this.lastOrigin = null;
        }
Пример #4
0
    private void MouseUp(Window32Msg.MouseOrigin origin, MouseButton arg1, MousePoint arg2)
    {
        MouseInputData data = new MouseInputData();

        data.Get((int)arg1).Up = true;

        OriginType type = OriginType.U3D_2D_MOUSE;

        switch (origin)
        {
        case Window32Msg.MouseOrigin.PRO_MOUSE: type = PROIs3DShow ? OriginType.PRO_3D_MOUSE : OriginType.PRO_2D_MOUSE; break;

        case Window32Msg.MouseOrigin.PRO_TOUCH: type = PROIs3DShow ? OriginType.PRO_3D_TOUCH : OriginType.PRO_2D_TOUCH; break;

        case Window32Msg.MouseOrigin.U3D_MOUSE: type = U3dIs3DShow ? OriginType.U3D_3D_MOUSE : OriginType.U3D_2D_MOUSE; break;

        case Window32Msg.MouseOrigin.U3D_TOUCH: type = U3dIs3DShow ? OriginType.U3D_3D_TOUCH : OriginType.U3D_2D_TOUCH; break;
        }
        if (m_LogLevel <= Common.LogLevel.DEBUG)
        {
            Common.AppLog.AddFormat(Common.LogLevel.DEBUG, "GCInput.MouseUp", $"Button={arg1.ToString()}  OriginType={type.ToString()} point={arg2.X} {arg2.Y}");
        }

        m_msgList.Add(new MsgData(type, data, new API.SPoint(arg2.X, arg2.Y)));
    }
Пример #5
0
 private void ZDK_NET_OnVideoStopped(Call call, OriginType origin)
 {
     if (OnZoiperEvent != null)
     {
         OnZoiperEvent("OnVideoStopped");
     }
 }
Пример #6
0
        public bool UpdateFromText(string inputtext)
        {
            bool retval = true;

            try
            {
                if (inputtext.Length >= 3)
                {
                    Direction = (inputtext[1] == '-' ? -1.0F : 1.0F);

                    if (char.IsLetter(inputtext[2]))
                    {
                        Origin = OriginType.Edge;
                        Value  = 0.0F;
                    }
                    else
                    {
                        Origin = (inputtext[0] == 'E' ? OriginType.Edge : OriginType.Midpoint);
                        Value  = Convert.ToDouble(inputtext.Substring(2));
                    }
                }
                else
                {
                    retval = false;
                }
            }
            catch (Exception /*ex*/)
            {
                retval = false;
            }

            return(retval);
        }
Пример #7
0
 /// <summary>
 /// Create a storyboard element by dynamic images.
 /// </summary>
 /// <param name="type">Set element type.</param>
 /// <param name="layer">Set element layer.</param>
 /// <param name="origin">Set element origin.</param>
 /// <param name="imagePath">Set image path.</param>
 /// <param name="defaultX">Set default x-coordinate of location.</param>
 /// <param name="defaultY">Set default x-coordinate of location.</param>
 /// <param name="frameCount">Set frame count.</param>
 /// <param name="frameDelay">Set frame rate (frame delay).</param>
 /// <param name="loopType">Set loop type.</param>
 public AnimatedElement(ElementType type, LayerType layer, OriginType origin, string imagePath, float defaultX,
                        float defaultY, int frameCount, float frameDelay, LoopType loopType) : base(type, layer, origin, imagePath, defaultX, defaultY)
 {
     FrameCount = frameCount;
     FrameDelay = frameDelay;
     LoopType   = loopType;
 }
Пример #8
0
 public IdentityDocument(Guid id, OriginType originType, Guid accountId, long lockVersion = 0)
 {
     Id          = id;
     OriginType  = originType;
     AccountId   = accountId;
     LockVersion = lockVersion;
 }
Пример #9
0
 public Sprite(Texture2D tex, OriginType type = OriginType.BottomLeft, Color?tint = null, float depth = 0f)
 {
     Texture = tex;
     Color   = tint ?? Color.White;
     SetOrigin(type);
     Depth = depth;
 }
Пример #10
0
 public Auditory MapLineHToAuditory(OriginType originType, DocType doctype, LineH lineH)
 {
     try
     {
         /* fec_doc, nro_doc, tip_doc, est_doc, fec_aud, usr_aud, est_aud, des_fil, est_fil, ORI_DOC */
         return(new Auditory()
         {
             fec_doc = lineH.invoice_date,
             nro_doc = IFSKeys.SERIE(doctype) + lineH.invoice_no,
             tip_doc = lineH.invoice_type,
             est_doc = 1,
             fec_aud = System.DateTime.Now,
             usr_aud = System.Environment.MachineName,
             est_aud = "",
             des_fil = "",
             est_fil = "1",
             ori_doc = originType.ToString()
         });
     }
     catch (Exception ex)
     {
         this._ILogService.Error(ex.Message);
     }
     return(null);
 }
Пример #11
0
        public static string GetTypeName(OriginType type)
        {
            switch (type)
            {
            case OriginType.Source:
                return(StringResources.DisplayFilterControl_Copied_from_source);

            case OriginType.AutoPropagated:
                return(StringResources.DisplayFilterControl_Auto_propagated);

            case OriginType.Exact:
                return(StringResources.DisplayFilterControl_Exact_matches);

            case OriginType.Fuzzy:
                return(StringResources.DisplayFilterControl_Fuzzy_matches);

            case OriginType.PM:
                return(StringResources.DisplayFilterControl_Perfect_matches);

            case OriginType.CM:
                return(StringResources.DisplayFilterControl_Context_matches);

            case OriginType.AT:
                return(StringResources.DisplayFilterControl_Automated_translations);

            default:
                return(type.ToString());
            }
        }
Пример #12
0
        public Texture2D(string name, MG_Texture2D inner, OriginType originType) : base(name)
        {
            this.inner = inner;
            switch (originType)
            {
            case OriginType.TopRight:
                this.Origin = new Point(this.Width, 0);
                break;

            case OriginType.BottomLeft:
                this.Origin = new Point(0, this.Height);
                break;

            case OriginType.BottomRight:
                this.Origin = new Point(this.Width, this.Height);
                break;

            case OriginType.Center:
                this.Origin = new Point(this.Width / 2, this.Height / 2);
                break;

            default:
                this.Origin = Point.Zero;
                break;
            }
        }
Пример #13
0
        private Origin <double> ParseOrigin(OriginType elementOrigin)
        {
            switch (elementOrigin)
            {
            case OriginType.TopLeft:
                return(Origins.TopLeft);

            case OriginType.TopCentre:
                return(Origins.TopCenter);

            case OriginType.TopRight:
                return(Origins.TopRight);

            case OriginType.CentreLeft:
                return(Origins.CenterLeft);

            case OriginType.Centre:
                return(Origins.Center);

            case OriginType.CentreRight:
                return(Origins.CenterRight);

            case OriginType.BottomLeft:
                return(Origins.BottomLeft);

            case OriginType.BottomCentre:
                return(Origins.BottomCenter);

            case OriginType.BottomRight:
                return(Origins.BottomRight);

            default:
                throw new ArgumentOutOfRangeException(nameof(elementOrigin), elementOrigin, null);
            }
        }
Пример #14
0
 public View(Size size)
 {
     Size = new Size()
     {
         W = size.W, H = size.H
     };
     OriginType = OriginType.ManualOrigin;
 }
Пример #15
0
 public View(int w, int h)
 {
     Size = new Size()
     {
         W = w, H = h
     };
     OriginType = OriginType.ManualOrigin;
 }
Пример #16
0
 public View()
 {
     Size = new Size()
     {
         W = 0, H = 0
     };
     OriginType = OriginType.ManualOrigin;
 }
Пример #17
0
 public static Texture2D LoadTexture2D(string assetPath, OriginType originType = OriginType.Center)
 {
     if (!texture2Ds.ContainsKey(assetPath))
     {
         texture2Ds.Add(assetPath, new Texture2D(assetPath, Load <MG_Texture2D>(assetPath), originType));
     }
     return(texture2Ds[assetPath]);
 }
Пример #18
0
 /// <summary>
 /// Create a storyboard element by a static image.
 /// </summary>
 /// <param name="type">Set element type.</param>
 /// <param name="layer">Set element layer.</param>
 /// <param name="origin">Set element origin.</param>
 /// <param name="imagePath">Set image path.</param>
 /// <param name="defaultX">Set default x-coordinate of location.</param>
 /// <param name="defaultY">Set default x-coordinate of location.</param>
 public Element(ElementType type, LayerType layer, OriginType origin, string imagePath, float defaultX, float defaultY)
 {
     Type       = type;
     Layer      = layer;
     Origin     = origin;
     ImagePath  = imagePath;
     DefaultX   = defaultX;
     DefaultY   = defaultY;
     _isLooping = false;
 }
Пример #19
0
 /// <summary>
 /// Creates a new client with the given origin type
 /// </summary>
 private Client(OriginType origin, string host, IPAddress clientIP, IPAddress proxyIP, string userAgent, bool https)
 {
     Origin                     = origin;
     Host                       = host;
     ClientIP                   = clientIP?.ToString();
     ProxyIP                    = proxyIP?.ToString();
     UserAgent                  = userAgent;
     HTTPS                      = https;
     ResourceAuthMappings       = new ConcurrentDictionary <IResource, byte>();
     ResourceClientDataMappings = new ConcurrentDictionary <IResource, IDictionary <string, object> >();
 }
Пример #20
0
 /// <summary>
 /// Creates a new client with the given origin type
 /// </summary>
 public Client(OriginType origin, string host, IPAddress clientIp, IPAddress proxyIp, string userAgent, bool https, Cookies cookies)
 {
     Origin                     = origin;
     Host                       = host;
     ClientIp                   = clientIp?.ToString();
     ProxyIp                    = proxyIp?.ToString();
     UserAgent                  = userAgent;
     Https                      = https;
     ResourceAuthMappings       = new ConcurrentDictionary <IResource, byte>();
     ResourceClientDataMappings = new ConcurrentDictionary <IResource, IDictionary <string, object> >();
     Cookies                    = cookies;
 }
Пример #21
0
 internal Sprite(Texture2D texture, Vector2 position, OriginType originType, Color color, float depth, object tag)
 {
     this.Texture = texture;
     this.Position = position;
     this.Color = color;
     this.Depth = depth;
     this.Tag = tag;
     this.OriginType = originType;
     this.Scale = new Vector2(1,1);
     this.Rotation = 0;
     this.Alpha = 1;
 }
Пример #22
0
        public void TestTranslatePreproc()
        {
            OriginType       ot1 = OriginType.CenterOfGravity;
            OriginType       ot2 = OriginType.Maximum;
            OriginType       ot3 = OriginType.Minimum;
            OriginType       ot4 = OriginType.Predefined;
            TranslatePreproc tp1 = new TranslatePreproc(ot1);
            TranslatePreproc tp2 = new TranslatePreproc(ot2);
            TranslatePreproc tp3 = new TranslatePreproc(ot3);
            TranslatePreproc tp4 = new TranslatePreproc(ot4);

            Assert.AreEqual(tp1.GoalOrigin, ot1);
            Assert.AreEqual(tp2.GoalOrigin, ot2);
            Assert.AreEqual(tp3.GoalOrigin, ot3);
            Assert.AreEqual(tp4.GoalOrigin, ot4);
        }
Пример #23
0
 public Ingredient(
     string name,
     OriginType origin,
     UnitMeasurmentType mType = UnitMeasurmentType.Weight_Units,
     bool isEssential         = false,
     string desc         = "",
     string picUrl       = "https://sciences.ucf.edu/psychology/wp-content/uploads/sites/63/2019/09/No-Image-Available.png",
     ApprovalStatus stat = ApprovalStatus.Awaiting)
 {
     Name        = name;
     Origin      = origin;
     MeasureType = mType;
     IsEssential = isEssential;
     Description = desc;
     PicUrl      = picUrl;
     Status      = stat;
 }
Пример #24
0
        public OperationResult writeIFSRegistersByOriginType(OriginType originType, DocType docType, List <IFSRegister> registers)
        {
            try
            {
                OperationResult result = null;
                switch (originType)
                {
                case OriginType.N4:
                    switch (docType)
                    {
                    case DocType.Factura:
                        result = _IIFSRepository.writeIFSRegisterForFacturaN4(registers);
                        foreach (IIFSRepository repository in this._RepositoriesToSync)
                        {
                            repository.syncRepository(result);
                        }
                        break;

                    case DocType.Boleta:
                        result = _IIFSRepository.writeIFSRegisterForBoletaN4(registers);
                        foreach (IIFSRepository repository in this._RepositoriesToSync)
                        {
                            repository.syncRepository(result);
                        }
                        break;

                    case DocType.NotaDeCreditoBoleta:
                    case DocType.NotaDeCreditoFactura:
                        result = _IIFSRepository.writeIFSRegisterForNotaCreditoN4(registers);
                        foreach (IIFSRepository repository in this._RepositoriesToSync)
                        {
                            repository.syncRepository(result);
                        }
                        break;
                    }
                    break;
                }
                return(result);
            }
            catch (Exception ex)
            {
                this._ILogService.Error(ex.Message);
            }
            return(null);
        }
Пример #25
0
 internal PackageInfo(string packageId, string displayName = "", string category = "", string description = "", string resolvedPath = "", string tag = "", PackageStatus status = PackageStatus.Unavailable, IEnumerable <Error> errors = null, VersionsInfo versions = null)
 {
     this.m_OriginType   = OriginType.Unknown;
     this.m_PackageId    = packageId;
     this.m_DisplayName  = displayName;
     this.m_Category     = category;
     this.m_Description  = description;
     this.m_ResolvedPath = resolvedPath;
     this.m_Status       = status;
     this.m_Errors       = (errors ?? new Error[0]).ToArray <Error>();
     this.m_Versions     = (versions ?? new VersionsInfo(null, null, null));
     string[] array = packageId.Split(new char[]
     {
         '@'
     });
     this.m_Name    = array[0];
     this.m_Version = array[1];
 }
Пример #26
0
    void Update()
    {
        // updating variable here, as opposed to doing it in Start(), otherwise we won't see runtime updates of forceSphereRadius
        sphRadius    = graphControl.NodePhysXForceSphereRadius;
        sphRadiusSqr = sphRadius * sphRadius;

        if (_isCentroid)
        {
            return;
        }


        // if this is a datapoint (not gene or centroid)
        if (OriginType.Equals(DataTypes.FILE_DATA) || OriginType.Equals(DataTypes.ADDED_DATA) && OriginType != DataTypes.GENE)
        {
            HandleDataPointOperations();

            // if links are active and need to be added/checked (new datapoints added or initial check)
            if (_nodeHandler.PPLinksActive && _nodeHandler.PPLinksUpdate)
            {
                UpdateDataDataAssociations();
                _nodeHandler.DataPointReportLinksUpdated();
            }

            // if linksactive is turned off, destroy any links to this point that may exist
            if (!_nodeHandler.PPLinksActive && LinksToAssociations.Count > 0)
            {
                Debug.Log("Destroying links");
                DestroyAssociationLinks();
            }
            if (_nodeHandler.PGLinksActive && _nodeHandler.PGLinksUpdate)
            {
                UpdateDataGeneAssociations();
                _nodeHandler.DataPointReportGeneLinksUpdated();
            }
            if (!_nodeHandler.PGLinksActive && LinksToGenes.Count > 0)
            {
                DestroyGeneLinks();
            }
        }
    }
Пример #27
0
        public static string GetTypeName(OriginType type)
        {
            switch (type)
            {
            case OriginType.Source:
                return(StringResources.DisplayFilterControl_Copied_from_source);

            case OriginType.AutoPropagated:
                return(StringResources.DisplayFilterControl_Auto_propagated);

            case OriginType.Exact:
                return(StringResources.DisplayFilterControl_Exact_matches);

            case OriginType.Fuzzy:
                return(StringResources.DisplayFilterControl_Fuzzy_matches);

            case OriginType.PM:
                return(StringResources.DisplayFilterControl_Perfect_matches);

            case OriginType.CM:
                return(StringResources.DisplayFilterControl_Context_matches);

            case OriginType.AT:
                return(StringResources.DisplayFilterControl_Automated_translations);

            case OriginType.FuzzyMatchRepair:
                return(StringResources.DisplayFilterControl_Fuzzy_Match_Repair);

            case OriginType.EditedFuzzy:
                return(StringResources.DisplayFilterControl_Edited_Fuzzy);

            case OriginType.UneditedFuzzy:
                return(StringResources.DisplayFilterControl_Unedited_Fuzzy);

            case OriginType.NMT:
                return(StringResources.DisplayFilterControl_Neural_Machine_Translation);

            default:
                return(type.ToString());
            }
        }
Пример #28
0
        public void SetOrigin(OriginType type)
        {
            switch (type)
            {
            case OriginType.BottomLeft:
            {
                Origin = new Vector2(0, Texture.Height);
                break;
            }

            case OriginType.BottomRight:
            {
                Origin = new Vector2(Texture.Width, Texture.Height);
                break;
            }

            case OriginType.TopRight:
            {
                Origin = new Vector2(Texture.Width, 0);
                break;
            }

            case OriginType.Center:
            {
                Origin = new Vector2((float)Texture.Width / 2, (float)Texture.Height / 2);
                break;
            }

            case OriginType.CenterPixel:
            {
                Origin = new Vector2(Texture.Width / 2, Texture.Height / 2);
                break;
            }

            default:
            {
                Origin = Vector2.Zero;
                break;
            }
            }
        }
Пример #29
0
        public Instrument(DataRow instrumentRow)
        {
            this.id = (Guid)instrumentRow["ID"];
            this.code = (string)instrumentRow["Code"];
            this.originCode = (string)instrumentRow["OriginCode"];
            this.numeratorUnit = (int)instrumentRow["NumeratorUnit"];
            this.denominator = (int)instrumentRow["Denominator"];
            this.isSinglePrice = (bool)instrumentRow["IsSinglePrice"];
            this.originType = (OriginType)(byte)instrumentRow["OriginType"];
            this.alertVariation = (int)instrumentRow["AlertVariation"];
            this.normalWaitTime = (int)instrumentRow["NormalWaitTime"];
            this.alertWaitTime = (int)instrumentRow["AlertWaitTime"];
            this.isActive = (bool)instrumentRow["IsActive"];

            this.originInactiveTime = (int)instrumentRow["OriginInactiveTime"];
            this.isPriceEnabled = (bool)instrumentRow["IsPriceEnabled"];
            this.isAutoEnablePrice = (bool)instrumentRow["IsAutoEnablePrice"];
            if (instrumentRow["ExternalExchangeCode"] != DBNull.Value)
            {
                this.exchangeSystem = (ExchangeSystem)Enum.Parse(typeof(ExchangeSystem), (string)(instrumentRow["ExternalExchangeCode"]), true);
            }
            else
            {
                this.exchangeSystem = ExchangeSystem.Local;
            }
            this.lastPriceEnabledTime = this.isPriceEnabled ? DateTime.Now : DateTime.MinValue;

            this.originQReceived = null;
            this.originQProcessed = null;
            this.quotePolicyDetails = new ArrayList();
            this.isTrading = false;
            this.scheduleID = null;
            this.lastOrigin = null;
        }
Пример #30
0
        public bool Update(XmlNode instrument)
        {
            bool priceMustRebuild = false;
            foreach (XmlAttribute attribute in instrument.Attributes)
            {
                switch (attribute.Name)
                {
                    case "OriginCode":
                        this.originCode = attribute.Value;
                        break;
                    case "Code":
                        this.code = attribute.Value;
                        break;
                    case "NumeratorUnit":
                        this.numeratorUnit = XmlConvert.ToInt32(attribute.Value);
                        priceMustRebuild = true;
                        break;
                    case "Denominator":
                        this.denominator = XmlConvert.ToInt32(attribute.Value);
                        priceMustRebuild = true;
                        break;
                    case "IsSinglePrice":
                        this.isSinglePrice = XmlConvert.ToBoolean(attribute.Value);
                        break;
                    case "OriginType":
                        this.originType = (OriginType)XmlConvert.ToInt32(attribute.Value);
                        break;
                    case "AlertVariation":
                        this.alertVariation = XmlConvert.ToInt32(attribute.Value);
                        break;
                    case "NormalWaitTime":
                        this.ClearScheduleIDIfNeed(attribute.Value);
                        this.normalWaitTime = XmlConvert.ToInt32(attribute.Value);
                        break;
                    case "AlertWaitTime":
                        this.alertWaitTime = XmlConvert.ToInt32(attribute.Value);
                        break;
                    case "IsActive":
                        this.isActive = XmlConvert.ToBoolean(attribute.Value);
                        break;

                    case "OriginInactiveTime":
                        this.originInactiveTime = XmlConvert.ToInt32(attribute.Value);
                        break;
                    case "IsPriceEnabled":
                        this.isPriceEnabled = XmlConvert.ToBoolean(attribute.Value);
                        if (this.isPriceEnabled)
                        {
                            this.lastPriceEnabledTime = DateTime.Now;
                        }
                        else
                        {
                            this.lastPriceEnabledTime = DateTime.MinValue;
                        }
                        break;
                    case "IsAutoEnablePrice":
                        this.isAutoEnablePrice = XmlConvert.ToBoolean(attribute.Value);
                        break;
                }
            }

            if (priceMustRebuild)
            {
                if (this.lastOrigin != null) this.lastOrigin = Price.CreateInstance((double)this.lastOrigin, this.numeratorUnit, this.denominator);
                this.RebuildQuotation();
            }
            return true;
        }
Пример #31
0
 /// <summary>
 ///  sets the origin.  Origin is normally not accessible since it can be deduced from the Packet type.
 ///  However, this allows setting the origin for reverse-engineering the protocol AND for future-compatibility:
 ///  if a new packet is built into a later version of Artemis, this library might not need updated to continue to support it.
 /// </summary>
 /// <param name="origin">The origin.</param>
 public void OverrideSetOrigin(OriginType origin)
 {
     Origin = origin;
 }
Пример #32
0
 /// <summary>
 ///  sets the origin.  Origin is normally not accessible since it can be deduced from the Packet type.
 ///  However, this allows setting the origin for reverse-engineering the protocol AND for future-compatibility:
 ///  if a new packet is built into a later version of Artemis, this library might not need updated to continue to support it.
 /// </summary>
 /// <param name="origin">The origin.</param>
 public void OverrideSetOrigin(OriginType origin)
 {
     Origin = origin;
 }
Пример #33
0
 public Sprite(Texture2D tex, Rectangle region, OriginType type = OriginType.TopLeft, Color?tint = null, float depth = 0f)
     : this(tex, type, tint)
 {
     Region = region;
     Depth  = depth;
 }
Пример #34
0
        public UIInstructor(Vector2 headPosition, float[] headWidth, float[] headHeight, Vector2 scale, OriginType originType, List <AnimationFrame>[] frames, TimeSpan updateTime, ElementReference[] head, ElementReference[] body, Vector2[] speeds, bool isStan = false)
        {
            this.scale  = scale;
            this.frames = frames;
            this.speeds = speeds;

            this.headWidths  = headWidth;
            this.headHeights = headHeight;

            if (isStan)
            {
                offSet  = 10;
                xOffSet = 0;
            }
            else
            {
                offSet  = 12;
                xOffSet = 0;
            }

            for (int i = 0; i < frames.Length; i++)
            {
                Head[i] = new Sprite(headPosition, (int)headWidth[i], (int)headHeight[i], scale, Rectangle.Empty, originType)
                {
                    Element = head[i]
                };
                var currHead = Head[i];
                Body[i] = new AnimationSprite(new Vector2(currHead.Position.X + xOffSet, currHead.Position.Y + currHead.ScaledHeight / 2 + frames[i][0].SourceRectangle.Height * scale.Y / 2 - offSet), scale, updateTime, frames[i], originType)
                {
                    Element = body[i]
                };
            }

            runner.Start();
        }
Пример #35
0
    public void ParseJson(JSONNode json)
    {
        // Set the start type
        if (json["origin"] != null)
        {
            switch (json["origin"].Value)
            {
            case "starting_location":
                origin = OriginType.START_LOCATION;
                break;
            }
        }

        // Get the world scale
        if (json["scale"] != null)
        {
            scale = json["scale"].AsFloat;
        }

        // Get the world scale
        if (json["remote"] != null)
        {
            var remoteJSON = json["remote"];

            // Create the remote if it did not already exist
            if (remote == null)
            {
                remote = new Remote();
            }

            // Set remote variables
            if (remoteJSON["address"] != null)
            {
                remote.address = remoteJSON["address"].Value;
            }
            if (remoteJSON["max_bit_rate"] != null)
            {
                remote.maxBitRate = remoteJSON["max_bit_rate"].AsInt;
            }
        }

        // Set the button gestures
        if (json["button_gestures"] != null)
        {
            foreach (var gestureJSON in json["button_gestures"].Children)
            {
                // Get existing gesture
                ButtonGesture gesture = new ButtonGesture(); // TODO: dont repeat gestures
                buttonGestures.Add(gesture);

                // Set the type
                switch (gestureJSON["type"].Value)
                {
                case "tap":
                    gesture.type = ButtonGesture.Type.TAP;
                    break;

                case "double_tap":
                    gesture.type = ButtonGesture.Type.DOUBLE_TAP;
                    break;

                case "hold":
                    gesture.type = ButtonGesture.Type.HOLD;
                    break;
                }

                gesture.mappings = GetMappings(gestureJSON["mapping"]);
            }
        }

        // Set the axes gestures
        if (json["axes_gestures"] != null)
        {
            foreach (var gestureJSON in json["axes_gestures"].Children)
            {
                // Get existing gesture
                AxesGesture gesture = new AxesGesture(); // TODO: dont repeat gestures
                axesGestures.Add(gesture);

                // Set the type
                switch (gestureJSON["type"].Value)
                {
                case "manipulation":
                    gesture.type = AxesGesture.Type.MANIPULATION;
                    break;

                case "navigation":
                    gesture.type = AxesGesture.Type.NAVIGATION;
                    break;
                }

                gesture.mappingsX = GetMappings(gestureJSON["mapping_x"]);
                gesture.mappingsY = GetMappings(gestureJSON["mapping_y"]);
                gesture.mappingsZ = GetMappings(gestureJSON["mapping_z"]);
            }
        }
    }