Exemple #1
0
        /// <summary>
        /// Returns true if PaymentLinks instances are equal
        /// </summary>
        /// <param name="other">Instance of PaymentLinks to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(PaymentDetailsLinks other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Self == other.Self ||
                     Self != null &&
                     Self.Equals(other.Self)
                     ) &&
                 (
                     Actions == other.Actions ||
                     Actions != null &&
                     Actions.Equals(other.Actions)
                 ) &&
                 (
                     Void == other.Void ||
                     Void != null &&
                     Void.Equals(other.Void)
                 ) &&
                 (
                     Refund == other.Refund ||
                     Refund != null &&
                     Refund.Equals(other.Refund)
                 ));
        }
Exemple #2
0
            IPromise <Void> _ChangeShipName(Primitive <string> name)
            {
                var oldName = Aos.Node.ShipAlias;

                Aos.Node.ShipAlias = name.Value;
                return(Void.Promise());
            }
Exemple #3
0
    /// <summary>
    /// All the void cells.
    /// </summary><returns>
    /// The void cells.</returns>
    public List<Void> AllVoidCells()
    {
        // All the void cells
        List<Void> allVoidCells = new List<Void> ();

        for (int i = 1; i < dungeonGenerator.numCellsX - 1; i++) {

            for (int k = 1; k < dungeonGenerator.numCellsZ - 1; k++) {

                if (CellIsVoid (dungeonGenerator.cellTypeGrid[i, dungeonGenerator.floorNumber, k])) {

                    // Void location
                    CellLocation voidLocation = new CellLocation (i, dungeonGenerator.floorNumber, k);

                    // Void cell
                    Void voidCell = new Void (voidLocation);

                    // Add the void cell to all void cells
                    allVoidCells.Add (voidCell);
                }
            }
        }

        // Return all of the void cells
        return allVoidCells;
    }
Exemple #4
0
    // Start is called before the first frame update
    protected virtual void Start()
    {
        this.initialized = true;
        this.stateTimer  = 0f;
        this.velocity    = Vector2.zero;
        this.enflamed    = false;
        this.pen         = FindObjectOfType <Pen>();
        this.gate        = FindObjectOfType <Gate>();
        this.item        = GetComponent <Item>();
        this.renderer    = GetComponentInChildren <SpriteRenderer>();
        this.emotion     = GetComponentInChildren <Emotion>();
        this.shoved      = false;
        this.fightCloud  = null;
        this.fire        = null;
        this.target      = null;
        this.avoid       = null;
        this.state       = State.WANDER;
        this.waypoint    = this.ChooseWaypoint(this.pen);
        this.orbManager  = GameObject.Find("OrbManager").GetComponent <OrbManager>();
        this.main        = GameObject.Find("Main").GetComponent <Main>();
        this.audioSource = GetComponent <AudioSource>();


        if (this.createdFromVoid)
        {
            this.state = State.SPAWNING_FROM_VOID;
            this.transform.localScale = new Vector3(0f, 0f, 1f);
        }

        this.voido = GameObject.Find("Void").GetComponent <Void>();
    }
Exemple #5
0
    // Start is called before the first frame update
    void Start()
    {
        this.audioSource      = GetComponent <AudioSource>();
        this.orbManager       = GameObject.Find("OrbManager").GetComponent <OrbManager>();
        this.emptyWaypoint    = GameObject.Find("EmptyWaypoint").GetComponentInChildren <Transform>();
        this.leverWaypoint    = GameObject.Find("LeverWaypoint").GetComponentInChildren <Transform>();
        this.slot1Waypoint    = GameObject.Find("Slot1Waypoint").GetComponentInChildren <Transform>();
        this.slot2Waypoint    = GameObject.Find("Slot2Waypoint").GetComponentInChildren <Transform>();
        this.slot1OrbWaypoint = GameObject.Find("Slot1OrbWaypoint").GetComponentInChildren <Transform>();
        this.slot2OrbWaypoint = GameObject.Find("Slot2OrbWaypoint").GetComponentInChildren <Transform>();
        this.orbPathWaypoint1 = GameObject.Find("OrbPathWaypoint1").GetComponentInChildren <Transform>();
        this.orbPathWaypoint2 = GameObject.Find("OrbPathWaypoint2").GetComponentInChildren <Transform>();
        this.spawnWaypoint    = GameObject.Find("SpawnWaypoint").GetComponentInChildren <Transform>();

        this.orbPath = new List <Vector3>();
        orbPath.Add(this.orbPathWaypoint1.position);
        orbPath.Add(this.orbPathWaypoint2.position);

        this.drawerSprite = GameObject.Find("SlotMachineDrawer").GetComponentInChildren <SpriteRenderer>();
        this.openSprite   = GameObject.Find("SlotMachineOpen").GetComponentInChildren <SpriteRenderer>();
        this.closedSprite = GameObject.Find("SlotMachineClosed").GetComponentInChildren <SpriteRenderer>();

        this.voido = GameObject.Find("Void").GetComponent <Void>();

        this.state = State.OPEN;
    }
 public Void VisitTypeDeclaration(TypeDeclaration ast, Void arg)
 {
     ast.Type = ast.Type.Visit(this, null);
     idTable.Enter(ast.Identifier, ast);
     CheckAndReportError(!ast.Duplicated, "identifier \"%\" already declared", ast.Identifier, ast);
     return(null);
 }
Exemple #7
0
        public Void VisitSequentialDeclaration(SequentialDeclaration ast, Void arg)
        {
            ast.FirstDeclaration.Visit(this, null);
            ast.SecondDeclaration.Visit(this, null);

            return(null);
        }
Exemple #8
0
        public TypeDenoter VisitTernaryExpression(TernaryExpression ast, Void arg)
        {
            TypeDenoter e2Type = ast.LeftExpression.Visit(this, null);
            TypeDenoter e3Type = ast.RightExpression.Visit(this, null);
            TypeDenoter e1Type = ast.Condition.Visit(this, null);

            if (e1Type is BoolTypeDenoter)
            {
                if (e1Type.Equals(true))
                {
                    ast.Type = e2Type;
                }
                else
                {
                    ast.Type = e3Type;
                    CheckAndReportError(e2Type.Equals(e3Type), "incompatible argument type for \"%\"", ast.Type.ToString(), ast.RightExpression.Position);
                }
            }
            else
            {
                ReportError("\"%\" is not a valid boolean", e1Type);
            }

            return(ast.Type);
        }
            //[SuppressMessage("Microsoft.Contracts", "Ensures-22-42", Justification="Depends on overriding")]
            public sealed override bool Visit(Expression exp, Void data)
            {
                Contract.Ensures(!Contract.Result <bool>() || result != null);

                result = default(NormalizedExpression <Variable>);
                return(base.Visit(exp, data));
            }
Exemple #10
0
 public Void VisitSequentialDeclaration(SequentialDeclaration ast, Void arg)
 {
     //0
     ast.firstDeclaration.Visit(this);
     ast.secondDeclaration.Visit(this);
     return(null);
 }
Exemple #11
0
        public TypeDenoter VisitTernaryExpression(TernaryExpression ast, Void arg)
        {
            TypeDenoter e1Type = ast.Condition.Visit(this, null);
            TypeDenoter e2Type = ast.LeftExpression.Visit(this, null);
            TypeDenoter e3Type = ast.RightExpression.Visit(this, null);

            if (e1Type == StandardEnvironment.BooleanType)
            {
                if (e2Type == e3Type)
                {
                    ast.Type = StandardEnvironment.AnyType;
                }
                else
                {
                    CheckAndReportError(e2Type.Equals(e3Type), "ternary expression member \"%\" must have the same type", ast.LeftExpression);
                    CheckAndReportError(e3Type.Equals(e2Type), "ternary expression member \"%\" must have the same type", ast.RightExpression);
                    ast.Type = StandardEnvironment.ErrorType;
                }
            }
            else
            {
                CheckAndReportError(e1Type.Equals(StandardEnvironment.BooleanType), "argument type \"%\" is not a boolean", ast.Condition);
                ast.Type = StandardEnvironment.ErrorType;
            }

            return(ast.Type);
        }
Exemple #12
0
        public static int Save(Void voids)
        {
            var a = new Void
            {
                VoidId = voids.VoidId,
                VoidDate = voids.VoidDate,
                VoidTime = voids.VoidTime,
                VoidAllOrder = voids.VoidAllOrder,
                OrderDetailId = voids.OrderDetailId,
                OrderId = voids.OrderId,
                UserId = voids.UserId,
                VoidReasonId = voids.VoidReasonId
            };

            using (_d = new DataRepository<Void>())
            {
                if (voids.VoidId > 0)
                    _d.Update(a);
                else _d.Add(a);

                _d.SaveChanges();
            }

            return a.VoidId;
        }
Exemple #13
0
            public IPromise <Void> ChangeShipNameAndId(string name, string id)
            {
                try
                {
                    var oldId = Aos.Node.ShipId;
                    Aos.Node.ShipAlias = name;
                    Aos.Node.ShipId    = id;
                    _gameContext.Me.UpdateName(Aos.Node.ShipId);

                    if (Aos.Node.IsMainNode)
                    {
                        var nameAndId = new Pair <Primitive <string>, Primitive <string> >
                        {
                            First  = name.AsPrimitive(),
                            Second = id.AsPrimitive()
                        };

                        ShipBroadcast($"T|System.ChangeShipNameAndId|{{{nameAndId.Stringify()}}}", oldId);
                    }

                    _log.Info($"Renamed {oldId} to {Aos.Node.ShipAlias}-{Aos.Node.ShipId}");

                    return(Void.Promise());
                }
                catch (Exception e)
                {
                    _log.Error($"Rename failed: {e}");
                    return(Promise <Void> .FromError(e));
                }
            }
 public Void VisitVarFormalParameter(VarFormalParameter ast, Void arg)
 {
     ast.Type = ast.Type.Visit(this, null);
     idTable.Enter(ast.Identifier, ast);
     CheckAndReportError(!ast.Duplicated, "duplicated formal parameter \"%\"", ast.Identifier, ast);
     return(null);
 }
Exemple #15
0
        public TypeDenoter VisitBinaryExpression(BinaryExpression ast, Void arg)
        {
            TypeDenoter e1Type  = ast.LeftExpression.Visit(this, null);
            TypeDenoter e2Type  = ast.RightExpression.Visit(this, null);
            Declaration binding = ast.Operation.Visit(this, null);

            if (binding is BinaryOperatorDeclaration bbinding)
            {
                if (bbinding.FirstArgument == StandardEnvironment.AnyType)
                {
                    CheckAndReportError(e1Type.Equals(e2Type), "incompatible argument types for \"%\"", ast.Operation, ast);
                }
                else
                {
                    CheckAndReportError(e1Type.Equals(bbinding.FirstArgument), "wrong argument type for \"%\"", ast.Operation, ast.LeftExpression);
                    CheckAndReportError(e2Type.Equals(bbinding.SecondArgument), "wrong argument type for \"%\"", ast.Operation, ast.RightExpression);
                }
                ast.Type = bbinding.Result;
            }
            else
            {
                ReportUndeclaredOrError(binding, ast.Operation, "\"%\" is not a binary operator");
                ast.Type = StandardEnvironment.ErrorType;
            }
            return(ast.Type);
        }
Exemple #16
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Self != null)
         {
             hashCode = hashCode * 59 + Self.GetHashCode();
         }
         if (Actions != null)
         {
             hashCode = hashCode * 59 + Actions.GetHashCode();
         }
         if (Void != null)
         {
             hashCode = hashCode * 59 + Void.GetHashCode();
         }
         if (Refund != null)
         {
             hashCode = hashCode * 59 + Refund.GetHashCode();
         }
         return(hashCode);
     }
 }
 public Void VisitLetCommand(LetCommand ast, Void arg)
 {
     _idTable.OpenScope();
     ast.Declaration.Visit(this);
     ast.Command.Visit(this);
     _idTable.CloseScope();
     return(null);
 }
 // аниация смены дня/ночи
 private IEnumerator BlackoutEvent(IEnumerator func, Void Event)
 {
     yield return EffectsControllerBG.BlackoutProcess();
     yield return func;
     if (Event != null) Event();
     yield return EffectsControllerBG.LighteningProcess();
     if (BlackOutAnimEnd != null) BlackOutAnimEnd();
 }
        public Void VisitWhileCommand(WhileCommand ast, Void arg)
        {
            System.Console.WriteLine("Visiting WhileCommand");
            TypeDenoter expressionType = ast.Expression.Visit(this, null);

            CheckAndReportError(expressionType.Equals(StandardEnvironment.BooleanType), "expression type must be boolean", ast);
            return(ast.Command.Visit(this, null));
        }
        private static void Main(string[] args)
        {
            // Instaniate the class into an object
            Void myClass = new Void();

            // Call the method with named parameters
            myClass.Function(numOne: 10, numTwo: 100);
        }
 public Void VisitConstDeclaration(ConstDeclaration ast, Void arg)
 {
     ast.Expression.Visit(this);
     _idTable.Enter(ast.Identifier, ast);
     CheckAndReportError(!ast.Duplicated, "identifier \"%\" already declared",
                         ast.Identifier, ast);
     return(null);
 }
Exemple #22
0
        public static System.Double Add(System.Double first, Void _, System.Double second_lo, System.Double second_hi, out System.Double result_hi)
        {
            var tl = BigAdd(first, second_hi, out var th);

            tl       += second_lo;
            th        = BigAddPartial(th, tl, out tl);
            result_hi = th;
            return(tl);
        }
 public Void VisitLetCommand(LetCommand ast, Void arg)
 {
     System.Console.WriteLine("Visiting letCommand");
     idTable.OpenScope();
     ast.Declaration.Visit(this, null);
     ast.Command.Visit(this, null);
     idTable.CloseScope();
     return(null);
 }
Exemple #24
0
        public static System.Double Multiply(Void _, System.Double first, System.Double second_lo, System.Double second_hi, out System.Double result_hi)
        {
            var tl = BigMul(first, second_hi, out var th);

            tl       += first * second_lo;
            tl        = BigAddPartial(th, tl, out th);
            result_hi = th;
            return(tl);
        }
Exemple #25
0
        public override async Task GetReservations(Void request, IServerStreamWriter <Reservation> responseStream, ServerCallContext context)
        {
            var reservations = await _gameService.GetReservationsAsync();

            foreach (var reservation in reservations)
            {
                await responseStream.WriteAsync(reservation.ToReservation());
            }
        }
Exemple #26
0
        /// <summary>
        /// Create an encoder that represents a lack of valid choices
        /// in a sequence of encoder choices, for example at the start.
        /// </summary>
        /// <remarks>
        /// Acts as an identity to Choose.
        /// </remarks>
        public static Encoder <TRaw, T> Lose <TRaw, T>([NotNull] Func <T, Void> f)
        {
            if (f == null)
            {
                throw new ArgumentNullException(nameof(f));
            }

            return(t => Void.Absurd <TRaw>(f(t)));
        }
        /// <inheritdoc />
        public override async Task GetAll(Void request, IServerStreamWriter <User> responseStream, ServerCallContext context)
        {
            var users = await _context.Users.ToListAsync();

            foreach (var user in users)
            {
                await responseStream.WriteAsync(_mapper.Map <User>(user));
            }
        }
Exemple #28
0
        public static Double Add(Double first_lo, Double first_hi, Double second, Void _, out Double result_hi)
        {
            var tl = BigAdd(first_hi, second, out var th);

            tl       += first_lo;
            th        = BigAddPartial(th, tl, out tl);
            result_hi = th;
            return(tl);
        }
Exemple #29
0
        public static Double Multiply(Double first_lo, Double first_hi, Void _, Double second, out Double result_hi)
        {
            var tl = BigMul(first_hi, second, out var th);

            tl       += first_lo * second;
            tl        = BigAddPartial(th, tl, out th);
            result_hi = th;
            return(tl);
        }
Exemple #30
0
        public static Double Subtract(Double first, Void _, Double second_lo, Double second_hi, out Double result_hi)
        {
            var tl = BigSubtract(first, second_hi, out var th);

            tl       -= second_lo;
            th        = BigAddPartial(th, tl, out tl);
            result_hi = th;
            return(tl);
        }
        public Void VisitWhileCommand(WhileCommand ast, Void arg)
        {
            var expressionType = ast.Expression.Visit(this);

            CheckAndReportError(expressionType == StandardEnvironment.BooleanType,
                                "Boolean expression expected here", ast.Expression);
            ast.Command.Visit(this);
            return(null);
        }
Exemple #32
0
    /// <summary>
    /// Voids is connected to void.
    /// </summary>
    /// <returns>
    /// Connected to void.
    /// </returns>
    /// <param name='startVoid'>If set to <c>true</c> start void.</param>
    /// <param name='goalVoid'>If set to <c>true</c> goal void.</param>
    /// <param name='knownExistingConnections'>If set to <c>true</c> known existing connections.</param>
    protected bool VoidConnectedToVoid(Void startVoid, Void goalVoid, ref ArrayList knownExistingConnections)
    {
        // Already searched locations
        ArrayList alreadySearchedList = new ArrayList();

        // Locations to search
        ArrayList toSearchList = new ArrayList();

        bool foundPath = false;
        bool doneWithSearch = false;

        // Add start void to the to search list
        toSearchList.Add(new CellLocation(startVoid.location.x, dungeonGenerator.floorNumber, startVoid.location.z));

        while (!doneWithSearch) {

            if (toSearchList.Count == 0) {

                // Search done
                doneWithSearch = true;
                break;
            }

            // Location to search
            CellLocation toSearch = (CellLocation)toSearchList[0];

            // Remove location from to search list
            toSearchList.RemoveAt(0);

            if (alreadySearchedList.Contains(toSearch) == false) {

                // Add location to already searched list
                alreadySearchedList.Add(toSearch);
            }

            if ((toSearch.x == goalVoid.location.x && toSearch.z == goalVoid.location.z) || knownExistingConnections.Contains(toSearch)) {

                // Search done
                doneWithSearch = true;

                // Path found
                foundPath = true;

                foreach (CellLocation pos in alreadySearchedList) {

                    // Add location to known existing connections
                    knownExistingConnections.Add(pos);
                }

                foreach (CellLocation pos in toSearchList) {

                    // Add location to known existing connections
                    knownExistingConnections.Add(pos);
                }

                break;
            }
            else {

                if (!dungeonGenerator.HasDir(toSearch, Dir.East) && toSearch.x < dungeonGenerator.numCellsX - 2) {

                    // The new location
                    CellLocation newLocation = new CellLocation(toSearch.x + 1, dungeonGenerator.floorNumber, toSearch.z);

                    if (toSearchList.Contains(newLocation) == false && alreadySearchedList.Contains(newLocation) == false) {

                        // Add the location to the to search list
                        toSearchList.Add(newLocation);
                    }
                }

                if (!dungeonGenerator.HasDir(toSearch, Dir.West) && toSearch.x > 1) {

                    // The new location
                    CellLocation newLocation = new CellLocation(toSearch.x - 1, dungeonGenerator.floorNumber, toSearch.z);

                    if (toSearchList.Contains(newLocation) == false && alreadySearchedList.Contains(newLocation) == false) {

                        // Add the location to the to search list
                        toSearchList.Add(newLocation);
                    }
                }

                if (!dungeonGenerator.HasDir(toSearch, Dir.North) && toSearch.z < dungeonGenerator.numCellsZ - 2) {

                    // The new location
                    CellLocation newLocation = new CellLocation(toSearch.x, dungeonGenerator.floorNumber, toSearch.z + 1);

                    if (toSearchList.Contains(newLocation) == false && alreadySearchedList.Contains(newLocation) == false) {

                        // Add the location to the to search list
                        toSearchList.Add(newLocation);
                    }
                }

                if (!dungeonGenerator.HasDir(toSearch, Dir.South) && toSearch.z > 1) {

                    // The new location
                    CellLocation newLocation = new CellLocation(toSearch.x, dungeonGenerator.floorNumber, toSearch.z - 1);

                    if (toSearchList.Contains(newLocation) == false && alreadySearchedList.Contains(newLocation) == false) {

                        // Add the location to the to search list
                        toSearchList.Add(newLocation);
                    }
                }
            }
        }

        // Path found
        return foundPath;
    }
 public override Task<Void> QuitWorker(Void request, ServerCallContext context)
 {
     stopRequestHandler();
     return Task.FromResult(new Void());
 }