コード例 #1
0
        public void PlayerstatisticPositionFieldCanBeSerializedAndDeserialized(EnumPosition position)
        {
            var playerStatistic = new Playerstatistic
            {
                FirstRaiserPosition = position,
                ThreeBettorPosition = position,
                FourBettorPosition  = position,
            };

            byte[] bytes = null;

            using (var memoryStream = new MemoryStream())
            {
                Serializer.Serialize(memoryStream, playerStatistic);
                bytes = memoryStream.ToArray();
            }

            var actualStat = SerializationHelper.Deserialize <Playerstatistic>(bytes);

            Assert.Multiple(() =>
            {
                Assert.That(actualStat.ThreeBettorPosition, Is.EqualTo(playerStatistic.ThreeBettorPosition));
                Assert.That(actualStat.FirstRaiserPosition, Is.EqualTo(playerStatistic.FirstRaiserPosition));
                Assert.That(actualStat.FourBettorPosition, Is.EqualTo(playerStatistic.FourBettorPosition));
            });
        }
コード例 #2
0
        public static IEnumerator SlideToPosition(RectTransform trm, EnumPosition position, NTemplate node, Vector2 point, float duration)
        {
            var canvas = DialogueDatabase.activeGraphPlayer.Canvas.transform as RectTransform;

            Vector2 posA = trm.anchoredPosition;
            Vector2 posB;

            if (position != EnumPosition.Custom)
            {
                posB = new Vector2(EngineGraphUtilities.GetXPosition(position), .5f);
            }
            else
            {
                posB = point;
            }

            posB = EngineGraphUtilities.FromAbsolutePositionToAnchoredPosition(trm, posB, canvas);

            float lerpValue = 0;
            float result    = 0;

            yield return(new WaitUntil(() =>
            {
                trm.anchoredPosition = Vector2.Lerp(posA, posB, result);

                lerpValue += Time.deltaTime;
                result = lerpValue / duration;

                return result >= 1;
            }));

            node.endedInstruction = true;
        }
コード例 #3
0
        public static IEnumerator FadeToPosition(Image image, EnumPosition position, NTemplate node, Vector2 point, float duration)
        {
            var canvas = DialogueDatabase.activeGraphPlayer.Canvas.transform as RectTransform;

            Vector2 pos;

            if (position != EnumPosition.Custom)
            {
                pos = new Vector2(EngineGraphUtilities.GetXPosition(position), .5f);
            }
            else
            {
                pos = point;
            }

            pos = EngineGraphUtilities.FromAbsolutePositionToAnchoredPosition(image.rectTransform, pos, canvas);

            var wait = new WaitForSeconds(duration / 2);

            image.CrossFadeAlpha(0, duration / 2, false);

            yield return(wait);

            image.rectTransform.anchoredPosition = pos;
            image.CrossFadeAlpha(1, duration / 2, false);

            yield return(wait);

            node.endedInstruction = true;
        }
コード例 #4
0
        public static void Instante(Image image, Sprite sprite, EnumPosition position, NTemplate node, Vector2 point, bool reverse = false)
        {
            if (!reverse)
            {
                image.sprite = sprite;
            }

            image.CrossFadeAlpha(reverse? 0 : 1, 0, false);

            if (!reverse)
            {
                Vector2 pos;

                if (position == EnumPosition.Custom)
                {
                    pos = point;
                }
                else
                {
                    pos = new Vector2(EngineGraphUtilities.GetXPosition(position), .5f);
                }

                image.rectTransform.anchoredPosition = EngineGraphUtilities.FromAbsolutePositionToAnchoredPosition(image.rectTransform, pos, DialogueDatabase.activeGraphPlayer.Canvas.transform as RectTransform);
            }

            node.endedInstruction = true;
        }
コード例 #5
0
ファイル: ConverterTests.cs プロジェクト: Michael-Z/DriveHud
        public void ToPositionTest(string fileName, string playerName, EnumPosition expectedPosition)
        {
            var hand = ParseHand(fileName);

            var actualPosition = Model.Importer.Converter.ToPosition(hand, playerName);

            Assert.That(actualPosition, Is.EqualTo(expectedPosition), "Positions must be the same.");
        }
コード例 #6
0
 // This constructor is made for FileHandler purposes
 public FullTime(String id, String fname, String lname, String social_security, String department,
                 String category, Date hire_date, Date birthday, Address address,
                 Phone home_ph, Phone cel_ph, String email, String contract, String position, String asalary) :
     base(id, fname, lname, social_security, department, category, hire_date, birthday, address, home_ph,
          cel_ph, email, contract)
 {
     this.position      = (EnumPosition)Enum.Parse(typeof(EnumPosition), position);
     this.annual_salary = Convert.ToDouble(asalary);
 }
コード例 #7
0
 public FullTime(String fname, String lname, String social_security, EnumDepartment department,
                 EnumCategory category, Date hire_date, Date birthday, Address address,
                 Phone home_ph, Phone cel_ph, String email, EnumPosition position, double asalary) :
     base(fname, lname, social_security, department, category, hire_date, birthday, address, home_ph,
          cel_ph, email)
 {
     this.position      = position;
     this.annual_salary = asalary;
 }
コード例 #8
0
        public static IEnumerator SlideUp(Image image, Sprite sprite, EnumPosition position, NTemplate node, Vector2 point, float duration, bool reverse = false)
        {
            if (!reverse)
            {
                image.sprite = sprite;
            }

            var canvas = DialogueDatabase.activeGraphPlayer.Canvas.transform as RectTransform;
            var trm    = image.rectTransform;

            Vector2 posA;
            Vector2 posB;

            if (position != EnumPosition.Custom)
            {
                posA = new Vector2(EngineGraphUtilities.GetXPosition(position), -.5f);
                posB = new Vector2(posA.x, .5f);
            }

            else
            {
                posA = new Vector2(point.x, -.5f);
                posB = point;
            }

            posA = EngineGraphUtilities.FromAbsolutePositionToAnchoredPosition(trm, posA, canvas);
            posB = reverse ? posB : EngineGraphUtilities.FromAbsolutePositionToAnchoredPosition(trm, posB, canvas);

            if (reverse)
            {
                posA.x = posB.x;
            }

            float lerpValue = 0;
            float result    = 0;

            yield return(new WaitUntil(() =>
            {
                if (reverse)
                {
                    trm.anchoredPosition = Vector2.Lerp(posB, posA, result);
                }
                else
                {
                    trm.anchoredPosition = Vector2.Lerp(posA, posB, result);
                }

                lerpValue += Time.deltaTime;
                result = lerpValue / duration;

                return result >= 1;
            }));

            node.endedInstruction = true;
        }
コード例 #9
0
        public void addNode(EnumPosition pos, Node newNode, int?position = null)
        {
            Node currentNode;

            switch (pos)
            {
            case EnumPosition.start:
                head.previous = newNode;
                newNode.next  = head;
                this.head     = newNode;
                break;

            case EnumPosition.end:
                currentNode = this.head;
                while (currentNode.next != null)
                {
                    currentNode = currentNode.next;
                }
                currentNode.next = newNode;
                break;

            case EnumPosition.index:
                currentNode = this.head;
                int i = 1;
                while (currentNode.next != null)
                {
                    if (i == position.GetValueOrDefault())
                    {
                        newNode.next              = currentNode;
                        newNode.previous          = currentNode.previous;
                        currentNode.previous.next = newNode;
                        currentNode.previous      = newNode;
                        break;
                    }
                    currentNode = currentNode.next;
                    i++;
                }

                break;
            }
        }
コード例 #10
0
        public static void InstanteToPosition(RectTransform trm, EnumPosition position, NTemplate node, Vector2 point)
        {
            var canvas = DialogueDatabase.activeGraphPlayer.Canvas.transform as RectTransform;

            Vector2 pos;

            if (position != EnumPosition.Custom)
            {
                pos = new Vector2(EngineGraphUtilities.GetXPosition(position), .5f);
            }
            else
            {
                pos = point;
            }

            pos = EngineGraphUtilities.FromAbsolutePositionToAnchoredPosition(trm, pos, canvas);

            trm.anchoredPosition = pos;

            node.endedInstruction = true;
        }
コード例 #11
0
ファイル: PositionalStat.cs プロジェクト: Michael-Z/DriveHud
        /// <summary>
        /// Adds positional values for the specified <see cref="EnumPosition"/>
        /// </summary>
        public void Add(EnumPosition position, int value)
        {
            switch (position)
            {
            case EnumPosition.BTN:
                BN += value;
                break;

            case EnumPosition.SB:
                SB += value;
                break;

            case EnumPosition.BB:
                BB += value;
                break;

            case EnumPosition.CO:
                CO += value;
                break;

            case EnumPosition.MP3:
            case EnumPosition.MP2:
            case EnumPosition.MP1:
            case EnumPosition.MP:
                MP += value;
                break;

            case EnumPosition.UTG:
            case EnumPosition.UTG_1:
            case EnumPosition.UTG_2:
            case EnumPosition.EP:
                EP += value;
                break;

            case EnumPosition.Undefined:
            default:
                break;
            }
        }
コード例 #12
0
ファイル: PositionalStat.cs プロジェクト: Michael-Z/DriveHud
        /// <summary>
        /// Sets the value for the specified <see cref="EnumPosition"/>
        /// </summary>
        public void SetPositionValue(EnumPosition position, int value)
        {
            switch (position)
            {
            case EnumPosition.BTN:
                BN = value;
                break;

            case EnumPosition.SB:
                SB = value;
                break;

            case EnumPosition.BB:
                BB = value;
                break;

            case EnumPosition.CO:
                CO = value;
                break;

            case EnumPosition.MP3:
            case EnumPosition.MP2:
            case EnumPosition.MP1:
            case EnumPosition.MP:
                MP = value;
                break;

            case EnumPosition.UTG:
            case EnumPosition.UTG_1:
            case EnumPosition.UTG_2:
            case EnumPosition.EP:
                EP = value;
                break;

            case EnumPosition.Undefined:
            default:
                break;
            }
        }
コード例 #13
0
        public void DrawArrow(int x, int y, EnumPosition position, bool start = true)
        {
            WriteableBitmap floorMap = start ? writeableBmpFloorStart : writeableBmpFloorFinish;

            switch (position)
            {
            case EnumPosition.Up:
            {
                floorMap.DrawLineAa(x, y, x - 10, y + 10, Color.FromArgb(255, 0, 0, 0), 5);
                floorMap.DrawLineAa(x, y, x + 10, y + 10, Color.FromArgb(255, 0, 0, 0), 5);
                break;
            }

            case EnumPosition.Right:
            {
                floorMap.DrawLineAa(x, y, x - 10, y - 10, Color.FromArgb(255, 0, 0, 0), 5);
                floorMap.DrawLineAa(x, y, x - 10, y + 10, Color.FromArgb(255, 0, 0, 0), 5);
                break;
            }

            case EnumPosition.Down:
            {
                floorMap.DrawLineAa(x, y, x - 10, y - 10, Color.FromArgb(255, 0, 0, 0), 5);
                floorMap.DrawLineAa(x, y, x + 10, y - 10, Color.FromArgb(255, 0, 0, 0), 5);
                break;
            }

            case EnumPosition.Left:
            {
                floorMap.DrawLineAa(x, y, x + 10, y - 10, Color.FromArgb(255, 0, 0, 0), 5);
                floorMap.DrawLineAa(x, y, x + 10, y + 10, Color.FromArgb(255, 0, 0, 0), 5);
                break;
            }

            default:
                break;
            }
        }
コード例 #14
0
        public void DrawArrow(int x, int y, EnumPosition position, bool start = true)
        {
            Canvas tempCanvas = start ? canvasStart : canvasFinish;

            switch (position)
            {
            case EnumPosition.Up:
            {
                tempCanvas.DrawLine(x, y, x - 10, y + 10, paint);
                tempCanvas.DrawLine(x, y, x + 10, y + 10, paint);
                break;
            }

            case EnumPosition.Right:
            {
                tempCanvas.DrawLine(x, y, x - 10, y - 10, paint);
                tempCanvas.DrawLine(x, y, x - 10, y + 10, paint);
                break;
            }

            case EnumPosition.Down:
            {
                tempCanvas.DrawLine(x, y, x - 10, y - 10, paint);
                tempCanvas.DrawLine(x, y, x + 10, y - 10, paint);
                break;
            }

            case EnumPosition.Left:
            {
                tempCanvas.DrawLine(x, y, x + 10, y - 10, paint);
                tempCanvas.DrawLine(x, y, x + 10, y + 10, paint);
                break;
            }

            default:
                break;
            }
        }
コード例 #15
0
        public static string ToPositionString(EnumPosition position)
        {
            switch (position)
            {
            case EnumPosition.BTN:
                return("BTN");

            case EnumPosition.SB:
                return("SB");

            case EnumPosition.BB:
                return("BB");

            case EnumPosition.CO:
                return("CO");

            case EnumPosition.MP3:
            case EnumPosition.MP2:
            case EnumPosition.MP1:
            case EnumPosition.MP:
                return("MP");

            case EnumPosition.UTG:
            case EnumPosition.UTG_1:
            case EnumPosition.UTG_2:
            case EnumPosition.EP:
                return("EP");

            case EnumPosition.STRDL:
                return("STRDL");

            case EnumPosition.Undefined:
            default:
                return("Undefined");
            }
        }
コード例 #16
0
 public void setPosition(EnumPosition position)
 {
     this.position = position;
 }
コード例 #17
0
 public static bool IsMPPosition(this EnumPosition position)
 {
     return(position == EnumPosition.MP || position == EnumPosition.MP1 ||
            position == EnumPosition.MP2 || position == EnumPosition.MP3);
 }
コード例 #18
0
 public static bool IsEPPosition(this EnumPosition position)
 {
     return(position == EnumPosition.EP || position == EnumPosition.UTG ||
            position == EnumPosition.UTG_1 || position == EnumPosition.UTG_2);
 }
コード例 #19
0
 public static void SetIconPosition(DependencyObject obj, EnumPosition value)
 {
     obj.SetValue(IconPositionProperty, value);
 }
コード例 #20
0
 public static bool IsCOPosition(this EnumPosition position)
 {
     return(position == EnumPosition.CO);
 }
コード例 #21
0
 static JDFAutoLabelingParams()
 {
     atrInfoTable[0] = new AtrInfoTable(AttributeName.CTM, 0x33333331, AttributeInfo.EnumAttributeType.matrix, null, null);
     atrInfoTable[1] = new AtrInfoTable(AttributeName.APPLICATION, 0x33333331, AttributeInfo.EnumAttributeType.NMTOKEN, null, null);
     atrInfoTable[2] = new AtrInfoTable(AttributeName.POSITION, 0x33333331, AttributeInfo.EnumAttributeType.enumeration, EnumPosition.getEnum(0), null);
 }
コード例 #22
0
 public static bool IsBTNPosition(this EnumPosition position)
 {
     return(position == EnumPosition.BTN);
 }
コード例 #23
0
 ///
 ///          <summary> * (9) get attribute Position </summary>
 ///          * <returns> the value of the attribute </returns>
 ///
 public virtual EnumPosition getPosition()
 {
     return(EnumPosition.getEnum(getAttribute(AttributeName.POSITION, null, null)));
 }
コード例 #24
0
 //         ---------------------------------------------------------------------
 //        Methods for Attribute Position
 //        ---------------------------------------------------------------------
 ///
 ///          <summary> * (5) set attribute Position </summary>
 ///          * <param name="enumVar">: the enumVar to set the attribute to </param>
 ///
 public virtual void setPosition(EnumPosition enumVar)
 {
     setAttribute(AttributeName.POSITION, enumVar == null ? null : enumVar.getName(), null);
 }
コード例 #25
0
 static JDFAutoIdentificationField()
 {
     atrInfoTable[0]  = new AtrInfoTable(AttributeName.ENCODING, 0x22222222, AttributeInfo.EnumAttributeType.enumeration, EnumEncoding.getEnum(0), null);
     atrInfoTable[1]  = new AtrInfoTable(AttributeName.ENCODINGDETAILS, 0x22222222, AttributeInfo.EnumAttributeType.NMTOKEN, null, null);
     atrInfoTable[2]  = new AtrInfoTable(AttributeName.BOUNDINGBOX, 0x33333333, AttributeInfo.EnumAttributeType.rectangle, null, null);
     atrInfoTable[3]  = new AtrInfoTable(AttributeName.FORMAT, 0x33333333, AttributeInfo.EnumAttributeType.Any, null, null);
     atrInfoTable[4]  = new AtrInfoTable(AttributeName.ORIENTATION, 0x33333333, AttributeInfo.EnumAttributeType.matrix, null, null);
     atrInfoTable[5]  = new AtrInfoTable(AttributeName.PAGE, 0x33333333, AttributeInfo.EnumAttributeType.integer, null, null);
     atrInfoTable[6]  = new AtrInfoTable(AttributeName.POSITION, 0x33333333, AttributeInfo.EnumAttributeType.enumeration, EnumPosition.getEnum(0), null);
     atrInfoTable[7]  = new AtrInfoTable(AttributeName.PURPOSE, 0x33333333, AttributeInfo.EnumAttributeType.enumeration, EnumPurpose.getEnum(0), null);
     atrInfoTable[8]  = new AtrInfoTable(AttributeName.PURPOSEDETAILS, 0x33333111, AttributeInfo.EnumAttributeType.NMTOKEN, null, null);
     atrInfoTable[9]  = new AtrInfoTable(AttributeName.VALUE, 0x33333331, AttributeInfo.EnumAttributeType.string_, null, null);
     atrInfoTable[10] = new AtrInfoTable(AttributeName.VALUEFORMAT, 0x33333111, AttributeInfo.EnumAttributeType.string_, null, null);
     atrInfoTable[11] = new AtrInfoTable(AttributeName.VALUETEMPLATE, 0x33333111, AttributeInfo.EnumAttributeType.string_, null, null);
 }
コード例 #26
0
 public static bool IsStraddlePosition(this EnumPosition position)
 {
     return(position == EnumPosition.STRDL);
 }
コード例 #27
0
 public static bool IsSBPosition(this EnumPosition position)
 {
     return(position == EnumPosition.SB);
 }
コード例 #28
0
 public HtmlTagAttribute(string tag, string type, EnumPosition position)
 {
     this._tag      = tag;
     this._type     = type;
     this._position = position;
 }
コード例 #29
0
 public FullTime(EnumPosition position, double asalary)
 {
     this.position      = position;
     this.annual_salary = asalary;
 }