Example #1
0
 public bool TeleportAvailable(SlotInfo Slot)
 {
     if (Slot == TeleportSlot1)
     {
         if (TeleportSlot2.InsideBubbleType == BubbleType.Null)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else if (Slot == TeleportSlot2)
     {
         if (TeleportSlot1.InsideBubbleType == BubbleType.Null)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }
Example #2
0
    public void ChangeGrenadeAmmo()
    {
        SlotInfo sInfo = gc.slotsController.habilitySlots[grenadesSlotNum].GetComponent <SlotInfo>();

        sInfo.Consume();
        grenadeAmmo--;
    }
    public override void ProcessStep()
    {
        _childData = navHandleData.GetChildNavData();
        if (_childData != null)
        {
            NavGroup group = (NavGroup)navHandleData.entity;
            for (int i = 0; i < _childData.Count; i++)
            {
                _slotInfo = group.GetSlotInfoByEntityID(_childData[i].entityID);
                if (_slotInfo == null)
                {
                    continue;
                }

                float speed    = _childData[i].entity.maxSpeed;
                float distance = Vector3.Distance(NavEntity.GetCurrentPosition(_childData[i].entityID), _slotInfo.slotWorldPosition) *
                                 (1f / NavHandleData.NAV_TICK_TIME);
                // 例如 一秒内距离小于3 速度为3 则速度为初始最大不变
                // 若距离大于3 例如6 则为两倍速
                if (distance > speed)
                {
                    speed = (distance / speed) * speed;
                }

                _childData[i].realVelocity = (_slotInfo.slotWorldPosition - NavEntity.GetCurrentPosition(_childData[i].entityID)).normalized * speed;
                Simulator.Instance.setAgentPrefVelocity(i, _childData[i].realVelocity.ToRVOVec2());
                //var dir = navHandleData.destination.XZ() - NavEntity.GetCurrentPosition(_childData[i].entityID).XZ();
                //Simulator.Instance.setAgentPrefVelocity(i, RVOMath.normalize(dir.ToRVOVec2()));
            }
        }
    }
Example #4
0
    public void SwapSlots(int id_o, int id_d, Transform image_o, Transform image_d)
    {
        //SWAP IMAGENES
        image_o.SetParent(InventoryPanel.GetChild(id_d));
        image_d.SetParent(InventoryPanel.GetChild(id_o));
        image_o.localPosition = Vector3.zero;
        image_d.localPosition = Vector3.zero;

        if (id_o != id_d)
        {
            SlotInfo origin      = slotInfoList[id_o];
            SlotInfo destination = slotInfoList[id_d];

            //SWAP EN INVENTARIO
            slotInfoList[id_o]    = destination;
            slotInfoList[id_o].id = id_o;
            slotInfoList[id_d]    = origin;
            slotInfoList[id_d].id = id_d;

            //SWAP EN LOS SLOTS BASADOS EN LOS CAMBIOS EN EL INVENTARIO

            Slot originSlot = InventoryPanel.GetChild(id_o).GetComponent <Slot>();
            originSlot.slotInfo = slotInfoList[id_o];
            Slot destinationSlot = InventoryPanel.GetChild(id_d).GetComponent <Slot>();
            destinationSlot.slotInfo = slotInfoList[id_d];

            originSlot.itemImage      = image_d.GetComponent <Image>();
            destinationSlot.itemImage = image_o.GetComponent <Image>();

            originSlot.amountText      = originSlot.itemImage.transform.GetChild(0).GetComponent <Text>();
            destinationSlot.amountText = destinationSlot.itemImage.transform.GetChild(0).GetComponent <Text>();
        }
    }
Example #5
0
    override protected void PreLoadData(XmlNode node)
    {
        base.PreLoadData(node);

        Slot = new SlotInfo(node.SelectSingleNode("SlotInfo"));

        Grades = new List <CreatureGrade>();
        foreach (XmlNode child in node.SelectSingleNode("CreatureGrade").ChildNodes)
        {
            Grades.Add(new CreatureGrade(child));
        }

        EnchantInfos = new List <CreatureEnchantInfo>();
        foreach (XmlNode child in node.SelectSingleNode("EnchantData").ChildNodes)
        {
            EnchantInfos.Add(new CreatureEnchantInfo(child));
        }

        XmlNode preset_node = node.SelectSingleNode("CreatureStatPreset");

        if (preset_node != null)
        {
            StatPresets = new List <CreatureStatPreset>();
            foreach (XmlNode child in preset_node.ChildNodes)
            {
                StatPresets.Add(new CreatureStatPreset(child));
            }
        }
    }
Example #6
0
        public SlotHistory GetHistory(int aggregateId)
        {
            var serializer = new JavaScriptSerializer();
            var history    = new SlotHistory {
                BookingId = aggregateId
            };

            var events = new EventRepository().All(aggregateId);

            foreach (var e in events)
            {
                var slot = new SlotInfo();
                switch (e.Action)
                {
                case "BookingCreatedEvent":
                    var createdEvent = serializer.Deserialize <BookingCreatedEvent>(e.Cargo);
                    slot           = createdEvent.Data;
                    slot.Action    = "Created";
                    slot.When      = createdEvent.When.ToLocalTime();;
                    slot.BookingId = createdEvent.Id;
                    break;

                case "BookingUpdatedEvent":
                    var updatedEvent = serializer.Deserialize <BookingUpdatedEvent>(e.Cargo);
                    slot           = updatedEvent.Data;
                    slot.Action    = "Updated";
                    slot.When      = updatedEvent.When.ToLocalTime();
                    slot.BookingId = updatedEvent.Id;
                    break;
                }

                history.ChangeList.Add(slot);
            }
            return(history);
        }
Example #7
0
        public override void OnCodeAnalysis(CodeAnalysisArgs args)
        {
            switch (args.Phase)
            {
            case CodeAnalysisPhase.Allocate:
                if (IsSet(AstNodeFlags.AllocateSlot) && !Scope.SlotDefined(Name))
                {
                    Slot = Scope.CreateSlot(Name);
                }
                break;

            case CodeAnalysisPhase.Binding:
                Slot = Scope.FindSlot(Name);
                if (Slot == null && !IsSet(AstNodeFlags.SuppressNotDefined))
                {
                    args.Context.ReportError(this.Location, "Variable " + Name + " is not declared");
                }
                if (Slot != null)
                {
                    //unless suppressed, mark this ID use as RValue
                    if (!IsSet(AstNodeFlags.NotRValue))
                    {
                        Slot.Flags |= SlotFlags.UsedAsRValue;
                    }
                    if (IsSet(AstNodeFlags.IsLValue))
                    {
                        Slot.Flags |= SlotFlags.ExplicitlyAssigned;
                    }
                }
                SetupEvaluateMethod();
                break;
            }//switch
            base.OnCodeAnalysis(args);
        }
    public void Init(SlotInfo slotInfo, int position)
    {
        // Top left, bottom right, bottom left, top right
        switch (position)
        {
        case 0:
            rectTransform.pivot = rectTransform.anchorMin = rectTransform.anchorMax = Vector2.up;
            break;

        case 1:
            rectTransform.pivot = rectTransform.anchorMin = rectTransform.anchorMax = Vector2.right;
            break;

        case 2:
            rectTransform.pivot = rectTransform.anchorMin = rectTransform.anchorMax = Vector2.zero;
            break;

        case 3:
            rectTransform.pivot = rectTransform.anchorMin = rectTransform.anchorMax = Vector2.one;
            break;

        default:
            break;
        }

        playerIndicator.rectTransform.rotation = UIHelper.PlayerIndicatorRotation(slotInfo.Index);

        stats            = Persistent.PlayerStats[slotInfo.Index];
        background.color = slotInfo.Color;
        kdCounter.text   = "0/0";
    }
Example #9
0
    protected override void OnOpen()
    {
        SlotInfo.ClearCurrentSlotLoaded();
        ((UserSlotData)UserData.instance).SetSlot(-1, false);
        SceneState.instance.SetGlobalValue(LevelController.timeTrialKey, 0, false);

        bool hasCleared = false;

        ModalSaveSlots modalSlots = UIModalManager.instance.ModalGetController <ModalSaveSlots>("slots");

        for (int i = 0; i < modalSlots.slots.Length; i++)
        {
            if (SlotInfo.HasClearTime(i))
            {
                hasCleared = true;
                break;
            }
        }

        if (hasCleared)
        {
            activeGOCleared.SetActive(true);
        }
        else
        {
            activeGODefault.SetActive(true);
        }
    }
    public void Init(SlotInfo slotInfo)
    {
        index = slotInfo.Index;

        // Appearance
        SetColor(slotInfo.Color);
    }
Example #11
0
    /// <summary>
    /// Generate the summary info of board
    /// </summary>
    public SlotInfo[,] GenerateBoardSummary()
    {
        if (boardUnit == null)
        {
            return(null);
        }

        var boardSummary = new SlotInfo[BoardInfo.Row, BoardInfo.Col];

        for (int i = 0; i < BoardInfo.Row; i++)
        {
            for (int j = 0; j < BoardInfo.Col; j++)
            {
                if (boardUnit[i, j] == null)
                {
                    boardSummary[i, j] = new SlotInfo()
                    {
                        type     = Unit.TypeEnum.Void,
                        owner    = Unit.OwnerEnum.None,
                        hasBread = boardBread[i, j] == null ? false : boardBread[i, j].Type == Unit.TypeEnum.Bread
                    };
                }
                else
                {
                    boardSummary[i, j] = new SlotInfo()
                    {
                        type     = boardUnit[i, j].Type,
                        owner    = boardUnit[i, j].Owner,
                        hasBread = boardBread[i, j] == null ? false : boardBread[i, j].Type == Unit.TypeEnum.Bread
                    };
                }
            }
        }
        return(boardSummary);
    }
Example #12
0
    public void AddItem(int itemId)
    {
        Objeto item = database.FindItemInDataBase(itemId); //Buscar en la base de datos

        if (item != null)
        {
            SlotInfo slotInfo = FindSuitableSlot(itemId); //Encontrar donde guardar el item;
            if (slotInfo != null)
            {
                FindSlot(slotInfo.id).slotInfo.amount++;
                FindSlot(slotInfo.id).slotInfo.itemId  = itemId;
                FindSlot(slotInfo.id).slotInfo.isEmpty = false;
                FindSlot(slotInfo.id).updateUI();



                slotInfo.amount++;
                slotInfo.itemId  = itemId;
                slotInfo.isEmpty = false;
            }
            else
            {
                Debug.Log("No hay hueco");
            }
        }
    }
Example #13
0
    private void LoadEmptyInventory()
    {
        gm = GameObject.FindGameObjectWithTag("GM").GetComponent <GameMaster>();
        if (gm.slotInfoList.Count != 0)
        {
            Debug.Log("CargoInvent");
            slotInfoList = gm.slotInfoList;

            for (int i = 0; i < capacity; i++)
            {
                GameObject slot    = Instantiate <GameObject>(slotPrefab, inventoryPanel);
                Slot       newSlot = slotPrefab.GetComponent <Slot>();
                newSlot.SetUp(0);
                newSlot.database = database;
                newSlot.slotInfo = slotInfoList[0];
                newSlot.updateUI();
            }
            // FindSlot(slotInfo.id).updateUI();
        }
        else
        {
            for (int i = 0; i < capacity; i++)
            {
                GameObject slot    = Instantiate <GameObject>(slotPrefab, inventoryPanel);
                Slot       newSlot = slotPrefab.GetComponent <Slot>();
                newSlot.SetUp(i);
                newSlot.database = database;
                SlotInfo newSlotInfo = newSlot.slotInfo;
                slotInfoList.Add(newSlotInfo);
                newSlot.updateUI();
            }
        }
    }
Example #14
0
    public void InitFormation(Vector3 center, Vector3 forward, int agentCount, int rowCount, float radius = 2f)
    {
        this.center           = center;
        this.formationForward = forward.normalized;
        this.rowCount         = rowCount;
        this.agentCount       = agentCount;
        this.radius           = radius;
        int        eachRowAgentNum = Mathf.CeilToInt(((float)agentCount / (float)rowCount));
        Quaternion rot             = Quaternion.FromToRotation(Vector3.forward, formationForward);
        int        fullCount       = agentCount / eachRowAgentNum;
        int        remain          = agentCount % eachRowAgentNum;

        for (int i = 0; i < fullCount; i++)
        {
            eachRowCountList.Add(eachRowAgentNum);
        }
        if (remain != 0)
        {
            eachRowCountList.Add(remain);
        }

        float halfVLength = radius * (eachRowCountList.Count - 1);
        float halfHLength = radius * (eachRowAgentNum - 1);

        for (int i = 0; i < eachRowCountList.Count; i++)
        {
            for (int j = 0; j < eachRowCountList[i]; j++)
            {
                Vector3  offset = new Vector3(-halfHLength + 2 * j * radius, 0, halfVLength - 2 * i * radius);
                SlotInfo info   = new SlotInfo(center, offset);
                slotInfoList.Add(info);
                info.slotWorldPosition = center + rot * info.offsetSlotMinusCenter;
            }
        }
    }
Example #15
0
        private SlotInfo[] CreateSlotInfosForCaseStatement(
            bool[] parentRequiredSlots,
            int foundSlot,
            CqlBlock childBlock,
            CaseStatement thisCaseStatement,
            IEnumerable <WithRelationship> withRelationships)
        {
            int num = childBlock.Slots.Count - this.TotalSlots;

            SlotInfo[] slotInfoArray = new SlotInfo[this.TotalSlots + num];
            for (int slotNum = 0; slotNum < this.TotalSlots; ++slotNum)
            {
                bool          isProjected        = childBlock.IsProjected(slotNum);
                bool          parentRequiredSlot = parentRequiredSlots[slotNum];
                ProjectedSlot slotValue          = childBlock.SlotValue(slotNum);
                MemberPath    outputMemberPath   = this.GetOutputMemberPath(slotNum);
                if (slotNum == foundSlot)
                {
                    slotValue   = (ProjectedSlot) new CaseStatementProjectedSlot(thisCaseStatement.DeepQualify(childBlock), withRelationships);
                    isProjected = true;
                }
                else if (isProjected && parentRequiredSlot)
                {
                    slotValue = (ProjectedSlot)childBlock.QualifySlotWithBlockAlias(slotNum);
                }
                SlotInfo slotInfo = new SlotInfo(parentRequiredSlot && isProjected, isProjected, slotValue, outputMemberPath);
                slotInfoArray[slotNum] = slotInfo;
            }
            for (int totalSlots = this.TotalSlots; totalSlots < this.TotalSlots + num; ++totalSlots)
            {
                QualifiedSlot qualifiedSlot = childBlock.QualifySlotWithBlockAlias(totalSlots);
                slotInfoArray[totalSlots] = new SlotInfo(true, true, (ProjectedSlot)qualifiedSlot, childBlock.MemberPath(totalSlots));
            }
            return(slotInfoArray);
        }
Example #16
0
    void UpdateDisplay()
    {
        if (_myslot.IsOpen)
        {
            BG.ToggleWindowOn();
            SlotInfo.ToggleWindowOn();
            SlotOptions.ToggleWindowOff();

            //Update the slot visuals.
            _sprIcon.spriteName = _myslot.IconName;
            //_lblSlotName.text = "Tap to Select";
        }
        else
        {
            BG.ToggleWindowOff();
            SlotOptions.ToggleWindowOn();
            SlotInfo.ToggleWindowOff();

            _lblSlotName.text = "Add Slot";
        }

        if (_CostLabel)
        {
            float cost = (float)_myslot.Cost / 100.0f;

            string format = string.Format("{0:C}", cost);
            _CostLabel.text = format;
        }
    }
Example #17
0
    public SerialTasks GetMapDisappearTask()
    {
        SerialTasks MapDisappearTask = new SerialTasks();

        ParallelTasks SlotDisappearTasks = new ParallelTasks();

        ParallelTasks BubbleDisappearTasks = new ParallelTasks();

        foreach (Transform child in AllBubble.transform)
        {
            Color color = child.GetComponent <SpriteRenderer>().color;
            BubbleDisappearTasks.Add(new ColorChangeTask(child.gameObject, Utility.ColorWithAlpha(color, 1), Utility.ColorWithAlpha(color, 0), MapUnitAppearTime, ColorChangeType.Sprite));
        }

        foreach (Transform child in AllSlot.transform)
        {
            Color color = child.GetComponent <SpriteRenderer>().color;
            SlotDisappearTasks.Add(new ColorChangeTask(child.gameObject, Utility.ColorWithAlpha(color, 1), Utility.ColorWithAlpha(color, 0), MapUnitAppearTime, ColorChangeType.Sprite));
            SlotInfo Info = child.GetComponent <SlotObject>().ConnectedSlotInfo;
            SlotDisappearTasks.Add(new TransformTask(child.gameObject, Info.Location, Info.Location * MapSlotInitPosOffsetFactor, MapUnitAppearTime));
        }

        MapDisappearTask.Add(BubbleDisappearTasks);
        MapDisappearTask.Add(SlotDisappearTasks);

        return(MapDisappearTask);
    }
Example #18
0
    public List <SlotInfo> LoadBagInfo()
    {
        List <SlotInfo> slotInfos = new List <SlotInfo>();
        string          sql       = "select * from bag_item_information where user_id=" + GameConfig.UserId;
        DataTable       dt        = MysqlHelper.ExecuteTable(sql, CommandType.Text, null);

        if (dt.Rows.Count > 0)
        {
            foreach (DataRow dr in dt.Rows)
            {
                SlotInfo slotInfo = new SlotInfo();
                slotInfo.SlotID    = int.Parse(dr["slot_id"].ToString());
                slotInfo.ItemCount = int.Parse(dr["slot_item_count"].ToString());
                if (dr["item_id"] == DBNull.Value)
                {
                    slotInfo.ItemID = -1;
                }
                else
                {
                    slotInfo.ItemID = int.Parse(dr["item_id"].ToString());
                }
                slotInfos.Add(slotInfo);
            }
        }
        slotInfos.Sort(delegate(SlotInfo x, SlotInfo y)
        {
            return(x.SlotID.CompareTo(y.SlotID));
        });
        return(slotInfos);
    }
	public SlotInfo GetSlotInfo(Transform slot)
	{
		SlotInfo slotInfo = new SlotInfo ();
		int slotIndex = 0;
		foreach (InventoryEquipmentUI.SlotInfo info in equipmentUI.slots) {
			if (slot == info.slot)
			{
				slotInfo.type = SlotType.Equipment;
				slotInfo.slotIndex = slotIndex;
				slotInfo.wagonIndex = -1;
				return slotInfo;
			}
			slotIndex += 1;
		}

		int wagonIndex = 0;
		foreach (WagonInventoryUI wagonUI in wagonUIs) {
			if (wagonUI.slots.Contains (slot)) {
				slotInfo.type =  SlotType.Wagon;
				slotInfo.slotIndex = wagonUI.slots.IndexOf(slot);
				slotInfo.wagonIndex = wagonIndex;
				return slotInfo;
			}
			wagonIndex += 1;
		}
		if (shopInventory.slots.Contains (slot)) {
			slotInfo.type =  SlotType.Shop;
			slotInfo.slotIndex = shopInventory.slots.IndexOf(slot);
			slotInfo.wagonIndex = -1;
			return slotInfo;
		}
		//Debug.Log ("GetSlotType Broken! "+slot);
		return null;
	}
Example #20
0
    public void Init(int slot)
    {
        mExists = UserSlotData.IsSlotExist(slot);
        if (mExists)
        {
            infoGO.SetActive(true);
            deleteGO.SetActive(true);
            newGO.SetActive(false);

            switch (SlotInfo.GetGameMode(slot))
            {
            case SlotInfo.GameMode.Hardcore:
                portrait.spriteName = SlotInfo.IsDead(slot) ? portraitDead : portraitHardcore;
                break;

            default:
                portrait.spriteName = portraitNormal;
                break;
            }

            for (int i = 0; i < weapons.Length; i++)
            {
                weapons[i].SetActive(SlotInfo.WeaponIsUnlock(slot, i + 1));
            }

            heartsLabel.text = "x" + SlotInfo.GetHeartCount(slot);

            int tankCount = 0;
            if (SlotInfo.IsSubTankEnergy1Acquired(slot))
            {
                tankCount++;
            }
            if (SlotInfo.IsSubTankEnergy2Acquired(slot))
            {
                tankCount++;
            }
            eTankLabel.text = "x" + tankCount;

            tankCount = 0;
            if (SlotInfo.IsSubTankWeapon1Acquired(slot))
            {
                tankCount++;
            }
            if (SlotInfo.IsSubTankWeapon2Acquired(slot))
            {
                tankCount++;
            }
            wTankLabel.text = "x" + tankCount;

            armor.color = SlotInfo.IsArmorAcquired(slot) ? Color.white : Color.black;

            clearTimeLabel.text = "CLEAR TIME: " + SlotInfo.GetClearTimeString(slot);
        }
        else
        {
            infoGO.SetActive(false);
            deleteGO.SetActive(false);
            newGO.SetActive(true);
        }
    }
Example #21
0
        static void Main(string[] args)
        {
            try
            {
                // Инициализировать библиотеку
                Console.WriteLine("Library initialization");
                using (var pkcs11 = new Pkcs11(Settings.RutokenEcpDllDefaultPath, Settings.OsLockingDefault))
                {
                    Console.WriteLine("Please attach or detach Rutoken and press Enter...");
                    Console.ReadKey();

                    for (var i = 0;; i++)
                    {
                        // Получить все события в слотах
                        // (не блокируя поток, используем флаг CKF_DONT_BLOCK)
                        bool  eventOccured = false;
                        ulong slotId       = 0;
                        pkcs11.WaitForSlotEvent(true, out eventOccured, out slotId);
                        if (!eventOccured)
                        {
                            break;
                        }

                        // Получить информацию о слоте
                        Slot     slot     = pkcs11.GetSlotList(false).Single(x => x.SlotId == slotId);
                        SlotInfo slotInfo = slot.GetSlotInfo();
                        Console.WriteLine(" Slot ID: {0}", slotId);
                        Console.WriteLine(" Slot description: {0}", slotInfo.SlotDescription);
                        Console.WriteLine(" Manufacturer: {0}", slotInfo.ManufacturerId);
                        Console.WriteLine(" Flags: 0x{0:X}", slotInfo.SlotFlags.Flags);
                        Console.WriteLine(" Hardware version: {0}", slotInfo.HardwareVersion);
                        Console.WriteLine(" Firmware version: {0}", slotInfo.FirmwareVersion);
                    }

                    // Запустить поток, ожидающий событие в каком-либо слоте.
                    // До наступления события выполнение запущенного потока заблокировано.
                    // Первое же событие разблокирует выполнение ожидающего потока.
                    // TODO: есть проблема с не срабатыванием события при числе потоков более одного
                    var tasksCount = 1;
                    for (var i = 0; i < tasksCount; i++)
                    {
                        var taskNumber = i;
                        Console.WriteLine("Starting monitoring thread number: {0}", taskNumber);
                        Task.Run(() => MonitoringTask(pkcs11, taskNumber));
                    }

                    Console.WriteLine("Please attach or detach Rutoken or press Enter to exit.");
                    Console.ReadKey();
                }
            }
            catch (Pkcs11Exception ex)
            {
                Console.WriteLine($"Operation failed [Method: {ex.Method}, RV: {ex.RV}]");
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Operation failed [Message: {ex.Message}]");
            }
        }
        private CqlBlock JoinToCqlBlock(
            bool[] requiredSlots,
            CqlIdentifiers identifiers,
            ref int blockAliasNum,
            ref List <WithRelationship> withRelationships)
        {
            int             length1  = requiredSlots.Length;
            List <CqlBlock> children = new List <CqlBlock>();
            List <Tuple <QualifiedSlot, MemberPath> > tupleList = new List <Tuple <QualifiedSlot, MemberPath> >();

            foreach (CellTreeNode child in this.Children)
            {
                bool[] projectedSlots = child.GetProjectedSlots();
                OpCellTreeNode.AndWith(projectedSlots, requiredSlots);
                CqlBlock cqlBlock = child.ToCqlBlock(projectedSlots, identifiers, ref blockAliasNum, ref withRelationships);
                children.Add(cqlBlock);
                for (int length2 = projectedSlots.Length; length2 < cqlBlock.Slots.Count; ++length2)
                {
                    tupleList.Add(Tuple.Create <QualifiedSlot, MemberPath>(cqlBlock.QualifySlotWithBlockAlias(length2), cqlBlock.MemberPath(length2)));
                }
            }
            SlotInfo[] slotInfos = new SlotInfo[length1 + tupleList.Count];
            for (int slotNum = 0; slotNum < length1; ++slotNum)
            {
                SlotInfo joinSlotInfo = this.GetJoinSlotInfo(this.OpType, requiredSlots[slotNum], children, slotNum, identifiers);
                slotInfos[slotNum] = joinSlotInfo;
            }
            int index1 = 0;
            int index2 = length1;

            while (index2 < length1 + tupleList.Count)
            {
                slotInfos[index2] = new SlotInfo(true, true, (ProjectedSlot)tupleList[index1].Item1, tupleList[index1].Item2);
                ++index2;
                ++index1;
            }
            List <JoinCqlBlock.OnClause> onClauses = new List <JoinCqlBlock.OnClause>();

            for (int index3 = 1; index3 < children.Count; ++index3)
            {
                CqlBlock cqlBlock = children[index3];
                JoinCqlBlock.OnClause onClause = new JoinCqlBlock.OnClause();
                foreach (int keySlot in this.KeySlots)
                {
                    if (!this.ViewgenContext.Config.IsValidationEnabled && (!cqlBlock.IsProjected(keySlot) || !children[0].IsProjected(keySlot)))
                    {
                        ErrorLog errorLog = new ErrorLog();
                        errorLog.AddEntry(new ErrorLog.Record(ViewGenErrorCode.NoJoinKeyOrFKProvidedInMapping, Strings.Viewgen_NoJoinKeyOrFK, (IEnumerable <LeftCellWrapper>) this.ViewgenContext.AllWrappersForExtent, string.Empty));
                        ExceptionHelpers.ThrowMappingException(errorLog, this.ViewgenContext.Config);
                    }
                    QualifiedSlot leftSlot     = children[0].QualifySlotWithBlockAlias(keySlot);
                    QualifiedSlot rightSlot    = cqlBlock.QualifySlotWithBlockAlias(keySlot);
                    MemberPath    outputMember = slotInfos[keySlot].OutputMember;
                    onClause.Add(leftSlot, outputMember, rightSlot, outputMember);
                }
                onClauses.Add(onClause);
            }
            return((CqlBlock) new JoinCqlBlock(this.OpType, slotInfos, children, onClauses, identifiers, ++blockAliasNum));
        }
Example #23
0
 public SlotBinding(SlotInfo slot, AstNode fromNode, ScopeInfo fromScope) : base(slot.Name, BindingTargetType.Slot) {
   Slot = slot;
   FromNode = fromNode;
   FromScope = fromScope;
   SlotIndex = slot.Index;
   StaticScopeIndex = Slot.ScopeInfo.StaticIndex;
   SetupAccessorMethods();
 }
    public void ReplaceType(SlotInfo newValue)
    {
        var index     = GameComponentsLookup.Type;
        var component = CreateComponent <TypeComponent>(index);

        component.value = newValue;
        ReplaceComponent(index, component);
    }
Example #25
0
 public object GetValue(SlotInfo slot)
 {
     Frame targetFrame = GetFrame(slot.Scope.Level);
       object result = targetFrame.Locals[slot.Index];
       if (result == Unassigned.Value)
     throw new RuntimeException("Access to unassigned variable " + slot.Name);
       return result;
 }
Example #26
0
 public int GetSlotBuyCash(SlotInfo slot)
 {
     int price = slot.CashDefault + slot.CashAdd * creature_count_buy_count;
     int price_max = slot.CashMax;
     if (price_max > 0)
         price = Math.Min(price, price_max);
     return price;
 }
 public BookingCreatedEvent(Guid requestId, int id, SlotInfo slotInfo)
 {
     RequestId = requestId;
     Id        = id;
     When      = DateTime.Now;
     Data      = slotInfo;
     SagaId    = id;
 }
Example #28
0
    public void AcquireArmor()
    {
        damageReduction = armorRating;

        int d = SlotInfo.GetItemsFlags();

        d |= SlotInfo.stateArmor;
        SlotInfo.SetItemsFlags(d);
    }
Example #29
0
    public void UseDirectHability(int num)
    {
        SlotInfo sInfo = gc.slotsController.habilitySlots[num].gameObject.GetComponent <SlotInfo>();

        if (sInfo.charges > 0)
        {
            HabilityEffect(sInfo, num);
        }
    }
 public BookingUpdatedEvent(int id, int hour, string name, int length)
 {
     Id     = id;
     When   = DateTime.Now;
     SagaId = id;
     Data   = new SlotInfo {
         BookingId = id, Name = name, StartingAt = hour, Length = length
     };
 }
Example #31
0
    public void UseDirectDeffense(int num)
    {
        SlotInfo sInfo = gc.slotsController.defenseSlots[num].gameObject.GetComponent <SlotInfo>();

        if (sInfo.charges > 0)
        {
            DefenseEffect(sInfo, num);
        }
    }
Example #32
0
    public void removerItem(int itemId)
    {
        SlotInfo slotInfo = EncontrarItemInventario(itemId);

        if (slotInfo != null)
        {
            slotInfo.EmptySlot();
            EncontrarSlot(slotInfo.id).UpdateUI();
        }
    }
Example #33
0
    void OnPickUp(ItemPickup itm)
    {
        int heartFlags = SlotInfo.GetHeartFlags(UserSlotData.currentSlot);
        int itemFlags  = SlotInfo.GetItemsFlags(UserSlotData.currentSlot);

        if (heartFlags == 255 && itemFlags == 31)
        {
            Notify();
        }
    }
Example #34
0
 public override void OnCodeAnalysis(CodeAnalysisArgs args) {
   switch (args.Phase) {
     case CodeAnalysisPhase.Allocate:
       if (IsSet(AstNodeFlags.AllocateSlot) && !Scope.SlotDefined(Name))
         Slot = Scope.CreateSlot(Name);
       break;
     case CodeAnalysisPhase.Binding:
       Slot = Scope.FindSlot(Name);
       if (Slot == null && !IsSet(AstNodeFlags.SuppressNotDefined))
         args.Context.ReportError(this.Location, "Variable " + Name + " is not declared");
       if (Slot != null) {
         //unless suppressed, mark this ID use as RValue
         if (!IsSet(AstNodeFlags.NotRValue))
           Slot.Flags |= SlotFlags.UsedAsRValue;
         if (IsSet(AstNodeFlags.IsLValue))
           Slot.Flags |= SlotFlags.ExplicitlyAssigned;
       }
       SetupEvaluateMethod();
       break;
   }//switch
   base.OnCodeAnalysis(args);
 }
Example #35
0
 private extern void GetSlotInfoInternal(SlotInfo info);
Example #36
0
    /// <summary>
    /// callback from driver for CI slot status
    /// </summary>
    /// <param name="Context">Can be used for a context pointer in the calling application. This parameter can be NULL.</param>
    /// <param name="nSlot">Is the Slot ID.</param>
    /// <param name="nStatus"></param>
    /// <param name="csInfo"></param>
    public unsafe void onSlotChange(
      IntPtr Context,
      byte nSlot,
      byte nStatus,
      SlotInfo* csInfo
      )
    {
      try
      {
        m_slotStatus = (TTCiSlotStatus)nStatus;
        Log.Log.Debug("TechnoTrend: slot {0} changed", nSlot);
        if (csInfo != null)
        {
          Log.Log.Debug("TechnoTrend:    CI status:{0} ", m_slotStatus);
          if (csInfo->pMenuTitleString != null)
          {
            Log.Log.Debug("TechnoTrend:    CI text  :{0} ", Marshal.PtrToStringAnsi(csInfo->pMenuTitleString));
          }

          for (int i = 0; i < csInfo->wNoOfCaSystemIDs; ++i)
          {
            Log.Log.Debug("TechnoTrend:      ca system id  :{0:X} ", csInfo->pCaSystemIDs[i]);
          }
        }
      }
      catch (Exception)
      {
        Log.Log.Debug("TechnoTrend: OnSlotChange() exception");
      }
    }
Example #37
0
 public void SetValue(SlotInfo slot, object value)
 {
     Frame f = GetFrame(slot.Scope.Level);
       f.Locals[slot.Index] = value;
 }