Exemple #1
0
        public Shape(Core.ShapeNS.Shape shape)
        {
            var shapeTransform = shape.transform;

            firstPosition    = shapeTransform.position;
            firstEulerAngles = shapeTransform.eulerAngles;
            shapeType        = shape.ShapeType;
            firstScale       = shapeTransform.localScale;
            acceptanceType   = shape.AcceptanceType;
        }
Exemple #2
0
        private GameObject InstantiateShape(ShapeType shapeType, AcceptanceType acceptanceType)
        {
            var acceptanceTypeCount = Enum.GetNames(typeof(AcceptanceType)).Length;
            var newGameObject       =
                Instantiate(shapePrefabs[((int)acceptanceType * acceptanceTypeCount) + (int)shapeType],
                            Global.farPosition, Quaternion.identity);

            if (acceptanceType == AcceptanceType.Acceptable)
            {
                newGameObject.AddComponent <AcceptableShape>().AcceptanceType = AcceptanceType.Acceptable;
            }
            else if (acceptanceType == AcceptanceType.UnAcceptable)
            {
                newGameObject.AddComponent <UnAcceptableShape>().AcceptanceType = AcceptanceType.UnAcceptable;
            }
            else
            {
                newGameObject.AddComponent <FillerShape>().AcceptanceType = AcceptanceType.None;
            }
            return(newGameObject);
        }
Exemple #3
0
        public void Respond(string organizationObjectId, AcceptanceType acceptType)
        {
            ORC.PlacerOrderNumber.UniversalID.Value = organizationObjectId;
            ORC.OrderControlCodeReason.Text.Value   = acceptType.ToString();
            switch (acceptType)
            {
            case AcceptanceType.Accepted:
                ORC.OrderControl.Value = OrderControlCode.OK.ToString();
                ORC.OrderStatus.Value  = OrderStatus.IP.ToString();
                break;

            case AcceptanceType.Declined:
                ORC.OrderControl.Value = OrderControlCode.UA.ToString();
                ORC.OrderStatus.Value  = OrderStatus.CA.ToString();
                break;
            }

            var theDateTime = DateTime.UtcNow;

            ORC.DateTimeOfTransaction.Time.SetLongDate(theDateTime);
            MSH.DateTimeOfMessage.Time.SetLongDate(theDateTime);
        }
Exemple #4
0
        public GameObject GetShapeGameObject(ShapeType shapeType, AcceptanceType acceptanceType)
        {
            var key = shapeType + acceptanceType.ToString();

            if (shapes.ContainsKey(key))
            {
                List <GameObject> shapeList = shapes[key];
                if (shapeList.Count == 0)
                {
                    return(InstantiateShape(shapeType, acceptanceType));
                }
                else
                {
                    GameObject willReturn = shapeList[shapeList.Count - 1];
                    shapeList.RemoveAt(shapeList.Count - 1);
                    willReturn.gameObject.SetActive(true);
                    return(willReturn);
                }
            }
            else
            {
                return(InstantiateShape(shapeType, acceptanceType));
            }
        }