Exemplo n.º 1
0
 private static void getWord(SemanticValueDict Semantics, Slots slot, List<string> keywords)
 {
     if (Semantics.HasSlot(slot))
      {
     keywords.Add(Semantics.GetSlot(slot));
      }
 }
Exemplo n.º 2
0
 public Bot(IrcClient irc) 
 {
     joinedUsers = new List<string>();
     vipUsers = new List<string>();
     rand = new Random();
     this.irc = irc;
     slots = new Slots();
 }
Exemplo n.º 3
0
        public Stream GetCsvSlots()
        {
            Stream stm = new MemoryStream(4096);

            Slots slots = new Slots();

            slots.GetCsv(stm);
            stm.Flush();
            stm.Seek(0, SeekOrigin.Begin);
            return stm;
        }
        public AsyncRequestManager(OpcDaGroup opcDaGroup)
        {
            var opcDataCallback = new OpcDataCallback
            {
                CancelComplete = OnCancelComplete,
                DataChange = OnDataChange,
                ReadComplete = OnReadComplete,
                WriteComplete = OnWriteComplete
            };

            _connectionPoint = new ConnectionPoint<IOPCDataCallback>(opcDataCallback);

            _slots = new Slots<IAsyncRequest>(OpcConfiguration.MaxSimultaneousRequests);
            _opcDaGroup = opcDaGroup;

            TryConnect(opcDaGroup.ComObject);
        }
Exemplo n.º 5
0
 public bool IsDragValid(DraggableItem item, GUIComponent slot)
 {
     if (!Slots.ContainsKey(slot))
     {
         return(true);
     }
     else
     {
         DraggableItem currentItem = Slots[slot];
         GItem         gItem       = currentItem.Item;
         if (gItem.Name != item.Item.Name)
         {
             return(false);
         }
         else
         {
             return(true);
         }
     }
 }
Exemplo n.º 6
0
        public BocsNodeDiffuseBsdf()
        {
            //NodeType* type = NodeType::add("diffuse_bsdf", create, NodeType::SHADER);

            //SOCKET_IN_COLOR(color, "Color", make_float3(0.8f, 0.8f, 0.8f));
            //SOCKET_IN_NORMAL(normal, "Normal", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL);
            //SOCKET_IN_FLOAT(surface_mix_weight, "SurfaceMixWeight", 0.0f, SocketType::SVM_INTERNAL);
            //SOCKET_IN_FLOAT(roughness, "Roughness", 0.0f);

            //SOCKET_OUT_CLOSURE(BSDF, "BSDF");

            NodeTitle = "Diffuse BSDF";
            NodeName  = "diffuse_bsdf";

            Slots.Add(new BocsSlotClosure(this, "BSDF", "bsdf", BocsSlotBase.BocsSlotType.Output));

            Slots.Add(new BocsSlotColor(this, "Color", "color", BocsSlotBase.BocsSlotType.Input, Color.white));
            Slots.Add(new BocsSlotFloat(this, "Roughness", "roughness", BocsSlotBase.BocsSlotType.Input, 0));
            Slots.Add(new BocsSlotClosure(this, "Normal", "normal", BocsSlotBase.BocsSlotType.Input));
        }
Exemplo n.º 7
0
        public override bool Run()
        {
            try
            {
                if (!Target.Line.WaitForTurn(this, SimQueue.WaitBehavior.Default, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached), Bookshelf.kTimeToWaitInLine))
                {
                    return(false);
                }

                try
                {
                    if (!Actor.RouteToSlot(Target, Slots.Hash("Route")))
                    {
                        return(false);
                    }
                }
                catch
                {
                    return(false);
                }

                IGameObject        result        = null;
                List <IGameObject> topStackItems = Target.Inventory.GetTopStackItems();
                result = ChooseBook(Actor, topStackItems);
                if (result == null)
                {
                    Actor.AddExitReason(ExitReason.FailedToRemoveFromInventory);
                    return(false);
                }
                return(Target.Read_GetBook(Actor, result, this));
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }
    public void Equip(Equipable item, Slots slot)
    {
        Equipable oldItem = null;

        if (item.slot == slot || item.slot == Slots.Mainhand && slot == Slots.Offhand && (item as Weapons).size != Weapons.WeaponsSize.Heavy)
        {
            if (equipment[slot] != null)
            {
                oldItem = equipment[slot];
            }
            equipment[slot] = item;
            foreach (Bonus bonus in item.bonuses)
            {
            }
        }


//		if (equip.slot == Slots.Mainhand) {
//			Weapons wep = equip as Weapons;
//			if (wep.size == Weapons.WeaponsSize.Heavy) {
//				weapons.Clear();
//				weapons.Add(wep);
//				equipment[Slots.Mainhand] = wep as Equipable;
//				equipment[Slots.Offhand] = null;
//			} else {
//				weapons.Add(wep);
//				equipment[Slots.Mainhand] = wep as Equipable;
//				if (weapons.Count >= 3) {
//					weapons.RemoveAt(0);
//
//				}
//				if (weapons.Count >= 2) {
//					equipment[Slots.Offhand] = wep as Equipable;
//					foreach (Weapons weapon in weapons) {
//						weapon.hitMod += -25;
//					}
//
//				}
//			}
//		}
    }
        public BocsNodeAnisotropicBsdf()
        {
            //NodeType* type = NodeType::add("anisotropic_bsdf", create, NodeType::SHADER);

            //SOCKET_IN_COLOR(color, "Color", make_float3(0.8f, 0.8f, 0.8f));
            //SOCKET_IN_NORMAL(normal, "Normal", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL);
            //SOCKET_IN_FLOAT(surface_mix_weight, "SurfaceMixWeight", 0.0f, SocketType::SVM_INTERNAL);

            //static NodeEnum distribution_enum;
            //distribution_enum.insert("beckmann", CLOSURE_BSDF_MICROFACET_BECKMANN_ANISO_ID);
            //distribution_enum.insert("GGX", CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID);
            //distribution_enum.insert("Multiscatter GGX", CLOSURE_BSDF_MICROFACET_MULTI_GGX_ANISO_ID);
            //distribution_enum.insert("ashikhmin_shirley", CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ANISO_ID);
            //SOCKET_ENUM(distribution, "Distribution", distribution_enum, CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID);

            //SOCKET_IN_VECTOR(tangent, "Tangent", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_TANGENT);

            //SOCKET_IN_FLOAT(roughness, "Roughness", 0.2f);
            //SOCKET_IN_FLOAT(anisotropy, "Anisotropy", 0.5f);
            //SOCKET_IN_FLOAT(rotation, "Rotation", 0.0f);

            //SOCKET_OUT_CLOSURE(BSDF, "BSDF");

            NodeTitle = "Anisotropic BSDF";
            NodeName  = "anisotropic_bsdf";

            Slots.Add(new BocsSlotClosure(this, "BSDF", "bsdf", BocsSlotBase.BocsSlotType.Output));

            BocsSlotStringList bsl = new BocsSlotStringList(this, "distribution", "distribution", BocsSlotBase.BocsSlotType.Value, 1);

            bsl.List = new string[] { "beckmann", "GGX", "Multiscatter GGX", "ashikhmin_shirley" };
            Slots.Add(bsl);

            Slots.Add(new BocsSlotColor(this, "Color", "color", BocsSlotBase.BocsSlotType.Input, Color.white));
            Slots.Add(new BocsSlotFloat(this, "Roughness", "roughness", BocsSlotBase.BocsSlotType.Input, .2f));
            Slots.Add(new BocsSlotFloat(this, "Anisotropy", "anisotropy", BocsSlotBase.BocsSlotType.Input, .5f));
            Slots.Add(new BocsSlotFloat(this, "Rotation", "rotation", BocsSlotBase.BocsSlotType.Input, 0));

            Slots.Add(new BocsSlotClosure(this, "Normal", "normal", BocsSlotBase.BocsSlotType.Input));
            Slots.Add(new BocsSlotClosure(this, "Tangent", "tangent", BocsSlotBase.BocsSlotType.Input));
        }
Exemplo n.º 10
0
        public void Swap(Item item1, Item item2)
        {
            if (item2.IsEmpty)
            {
                EquipIntoSlot(item1, FindContainingSlot(item2));
            }

            if (item1.SlotType != item2.SlotType)
            {
                return;
            }

            var index1 = Slots.IndexOf(Slots.First(slot => slot.Item.Equals(item1)));
            var index2 = Slots.IndexOf(Slots.First(slot => slot.Item.Equals(item2)));

            Unequip(item1);
            Unequip(item2);

            EquipIntoSlot(item1, Slots[index2]);
            EquipIntoSlot(item2, Slots[index1]);
        }
Exemplo n.º 11
0
        public BocsNodeNormal()
        {
            //NodeType* type = NodeType::add("normal", create, NodeType::SHADER);

            //SOCKET_VECTOR(direction, "direction", make_float3(0.0f, 0.0f, 0.0f));

            //SOCKET_IN_NORMAL(normal, "Normal", make_float3(0.0f, 0.0f, 0.0f));

            //SOCKET_OUT_NORMAL(normal, "Normal");
            //SOCKET_OUT_FLOAT(dot, "Dot");

            NodeTitle = "Normal";
            NodeName  = "normal";

            Slots.Add(new BocsSlotClosure(this, "Normal", "normal", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Dot", "dot", BocsSlotBase.BocsSlotType.Output));

            Slots.Add(new BocsSlotVector3(this, "Direction", "direction", BocsSlotBase.BocsSlotType.Value));

            Slots.Add(new BocsSlotClosure(this, "Normal", "normal", BocsSlotBase.BocsSlotType.Input));
        }
Exemplo n.º 12
0
        private void Override(Dictionary <VTableSignature, List <VTableSlot> > slotDict, VTableSignature sig, VTableSlot slot, MethodDef target)
        {
            List <VTableSlot> slotList   = slotDict[sig];
            VTableSlot        targetSlot = slotList.Single(baseSlot => baseSlot.MethodDef == target);

            if (slot.MethodDef.IsReuseSlot || targetSlot.MethodDef.DeclaringType.IsInterface)
            {
                slot.Override(targetSlot);
            }
            slotList.Remove(targetSlot);

            if (!slot.MethodDef.IsFinal)
            {
                slotDict.AddListEntry(slot.Signature, slot);
                Slots.Add(slot);
            }
            else
            {
                Finals.Add(slot);
            }
        }
Exemplo n.º 13
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Slots m = db.Slots.Find(id);

            if (m == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ManufacturerModelID = new SelectList(db.ManufacturerModels, "ManufacturerModelID", "Name", m.ManufacturerModelID);
            ViewBag.ManufacturerID      = new SelectList(db.Manufacturers, "ManufacturerID", "Name", m.ManufacturerID);
            ViewBag.VenueID             = new SelectList(db.OperatorVenues, "VenueID", "Name", m.VenueID);
            ViewBag.SlotModelID         = new SelectList(db.SlotModels, "SlotModelID", "Name", m.SlotModelID);
            ViewBag.SlotNameID          = new SelectList(db.SlotNames, "SlotNameID", "Name", m.SlotNameID);
            ViewBag.SlotStatusID        = new SelectList(db.SlotStatus, "SlotStatusID", "Status", m.SlotStatusID);
            ViewBag.SlotTypeID          = new SelectList(db.SlotTypes, "SlotTypeID", "Name", m.SlotTypeID);
            return(View(m));
        }
Exemplo n.º 14
0
        public void Copy(InventoryObject _inventory)
        {
            if (_inventory == null)
            {
                return;
            }

            base.Copy(_inventory);

            MaxSlots              = _inventory.MaxSlots;
            IgnoreInventoryOwner  = _inventory.IgnoreInventoryOwner;
            DefaultDropRange      = _inventory.DefaultDropRange;
            LastCollectedObjectID = _inventory.LastCollectedObjectID;
            UseDetachOnDie        = _inventory.UseDetachOnDie;

            Slots.Clear();
            foreach (InventorySlotObject _slot in _inventory.Slots)
            {
                Slots.Add(new InventorySlotObject(OwnerComponent, _slot));
            }
        }
Exemplo n.º 15
0
        private void _setSlot(Slots slot, IEntity entity)
        {
            if (_sprite != null && entity.TryGetComponent(out ClothingComponent clothing))
            {
                var flag = SlotMasks[slot];
                var data = clothing.GetEquippedStateInfo(flag);
                if (data == null)
                {
                    _sprite.LayerSetVisible(slot, false);
                }
                else
                {
                    var(rsi, state) = data.Value;
                    _sprite.LayerSetVisible(slot, true);
                    _sprite.LayerSetRSI(slot, rsi);
                    _sprite.LayerSetState(slot, state);
                }
            }

            _window?.AddToSlot(slot, entity);
        }
Exemplo n.º 16
0
        public ActionResult Create([Bind(Include = "SlotID,VenueID,SlotTypeID,SlotStatusID,SlotModelID,SlotNameID,ManufacturerID,ManufacturerModelID,IsOriginal,IsActive,DeviceCommissioned,DeviceDecommissioned,SerialNumber,AssetNumber,DeviceLocation")] Slots m)
        {
            // CHECK AGAINST CREATE AND EDIT FORMS
            m.IsAvailable = true;
            if (ModelState.IsValid)
            {
                db.Slots.Add(m);
                db.SaveChanges();
                return(RedirectToAction("Index", "Companies"));
            }

            ViewBag.ManufacturerModelID = new SelectList(db.ManufacturerModels, "ManufacturerModelID", "Name", m.ManufacturerModelID);
            ViewBag.ManufacturerID      = new SelectList(db.Manufacturers, "ManufacturerID", "Name", m.ManufacturerID);
            ViewBag.VenueID             = new SelectList(db.OperatorVenues, "VenueID", "Name", m.VenueID);
            ViewBag.SlotModelID         = new SelectList(db.SlotModels, "SlotModelID", "Name", m.SlotModelID);
            ViewBag.SlotNameID          = new SelectList(db.SlotNames, "SlotNameID", "Name", m.SlotNameID);
            ViewBag.SlotStatusID        = new SelectList(db.SlotStatus, "SlotStatusID", "Status", m.SlotStatusID);
            ViewBag.SlotTypeID          = new SelectList(db.SlotTypes, "SlotTypeID", "Name", m.SlotTypeID);

            return(View(m));
        }
Exemplo n.º 17
0
        public EquipmentSlots(ItemsHolder holder, NamelessGame game)
        {
            Slots.Add(new Tuple <Slot, EquipmentSlot>(Slot.Head, new EquipmentSlot(Slot.Head)));
            Slots.Add(new Tuple <Slot, EquipmentSlot>(Slot.Torso, new EquipmentSlot(Slot.Torso)));

            var slotLeft  = new EquipmentSlot(Slot.LefHand);
            var slotRight = new EquipmentSlot(Slot.RightHand);

            Slots.Add(new Tuple <Slot, EquipmentSlot>(Slot.LefHand, slotLeft));
            Slots.Add(new Tuple <Slot, EquipmentSlot>(Slot.RightHand, slotRight));

            Slots.Add(new Tuple <Slot, EquipmentSlot>(Slot.Feet, new EquipmentSlot(Slot.Feet)));
            Slots.Add(new Tuple <Slot, EquipmentSlot>(Slot.Legs, new EquipmentSlot(Slot.Legs)));
            Slots.Add(new Tuple <Slot, EquipmentSlot>(Slot.Neck, new EquipmentSlot(Slot.Neck)));
            Slots.Add(new Tuple <Slot, EquipmentSlot>(Slot.Ring1, new EquipmentSlot(Slot.Ring1)));
            Slots.Add(new Tuple <Slot, EquipmentSlot>(Slot.Ring2, new EquipmentSlot(Slot.Ring2)));
            Slots.Add(new Tuple <Slot, EquipmentSlot>(Slot.Hands, new EquipmentSlot(Slot.Hands)));

            Holder = holder;
            Game   = game;
        }
Exemplo n.º 18
0
    public void OnChangePackb()
    {
        Slots slots = UI.GetUI(BasePanel.Slots) as Slots;

        if (slots != null)
        {
            slots.OnChangePackB();
        }
        Friends friends = UI.GetUI(BasePanel.Friend) as Friends;

        if (friends != null)
        {
            friends.OnChangePackB();
        }
        Setting setting = UI.GetUI(PopPanel.Setting) as Setting;

        if (setting != null)
        {
            setting.OnChangePackB();
        }
    }
Exemplo n.º 19
0
        public BocsNodeLightFalloff()
        {
            //NodeType* type = NodeType::add("light_fallof", create, NodeType::SHADER);

            //SOCKET_IN_FLOAT(strength, "Strength", 100.0f);
            //SOCKET_IN_FLOAT(smooth, "Smooth", 0.0f);

            //SOCKET_OUT_FLOAT(quadratic, "Quadratic");
            //SOCKET_OUT_FLOAT(linear, "Linear");
            //SOCKET_OUT_FLOAT(constant, "Constant");

            NodeTitle = "Light Falloff";
            NodeName  = "light_fallof";//Yes cycles bug

            Slots.Add(new BocsSlotClosure(this, "Quadratic", "quadratic", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Linear", "linear", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Constant", "constant", BocsSlotBase.BocsSlotType.Output));

            Slots.Add(new BocsSlotFloat(this, "Strength", "strength", BocsSlotBase.BocsSlotType.Input, 100));
            Slots.Add(new BocsSlotFloat(this, "Smooth", "smooth", BocsSlotBase.BocsSlotType.Input, 0));
        }
Exemplo n.º 20
0
        public Schematic(Player player, SchematicData data)
        {
            _player       = player;
            SchematicData = data;

            foreach (SchematicSlotData slotData in SchematicData.Slots)
            {
                SchematicSlot slot = SchematicSlotFactory.Create(slotData);
                if (null == slot)
                {
                    continue;
                }

                _slots.Add(slotData.Id, slot);
                _slotList.Add(slot);
            }

#if UNITY_EDITOR
            _debugSlots = Slots.ToArray();
#endif
        }
Exemplo n.º 21
0
        public void Store(Item item, int amount = 1)
        {
            int maxStack  = Engine.GetItem(item.Id).StackSize;
            int remainder = amount;

            foreach (ItemData data in Slots)
            {
                if (data.Id == item.Id)
                {
                    if (data.Count + amount <= maxStack)
                    {
                        data.StackCount += amount;
                        return;
                    }
                    else
                    {
                        int remaining = maxStack - data.Count;
                        remainder        = amount - remaining;
                        data.StackCount += remaining;
                    }

                    break;
                }
            }

            int slotSize = (int)Math.Ceiling((double)maxStack / remainder);

            if (Slots.Count + slotSize > Capacity)
            {
                throw new Exception("This backpack does not have enough room to store the specified item.");
            }
            else
            {
                for (int i = 0; i < slotSize; i++)
                {
                    // todo: figure out how to initialize unique item data
                    Slots.Add(new ItemData(item.Id, maxStack));
                }
            }
        }
Exemplo n.º 22
0
        /// <summary>
        /// Initiate the standard address selection procedure to get/create a slot for the given loc.
        /// </summary>
        public Slot RequestSlot(ILocState loc)
        {
            var slot = Slots.FindByLoc(loc);

            if (slot != null)
            {
                // Slot already available
                return(slot);
            }

            var address = loc.Entity.Address.Value;

            log.Trace("Requesting slot for {0}", address);
            var req = new LocoAddressRequest(address);

            try
            {
                req.ExecuteAndWaitForResponse <SlotDataResponse>(
                    LocoBuffer,
                    x => (x.Address == address), RequestSlotTimeout);
            }
            catch (TimeoutException)
            {
                // No proper response
                log.Trace("Timeout on slot request for {0}", address);
                return(null);
            }
            var result = Slots.FindByAddress(address, false);

            if (result == null)
            {
                log.Error("Requesting slot succeeded, but no slot found for {0}", address);
            }
            else
            {
                log.Trace("Requested slot for {0}, using slot {1}", address, result.SlotNumber);
            }
            return(result);
        }
Exemplo n.º 23
0
        /// <summary>
        /// Check if the resource is still blocked
        /// </summary>
        /// <param name="resourceName"></param>
        /// <returns></returns>
        public static bool ResourceIsBlocked(string resourceName)
        {
            lock (SingletonKey)
            {
                var resource = Slots.GetResource(resourceName);
                if (resource == null)
                {
                    throw new IndexOutOfRangeException($"A resource named {resourceName} has not been setup with a runOnItsOwn context");
                }

                var blocked = Slots.Blocked(resource);
                if (!blocked)
                {
                    Log("*", resource);
                }
                else
                {
                    // Log("?", test); // Only for debugging to prove that block checks are ongoing
                }
                return(blocked);
            }
        }
Exemplo n.º 24
0
        public async Task SearchAppointmentsByYearMonthAsync_should_return_aggregate_given_slot()
        {
            await configManager !.SaveConfigAsync(new AppointmentConfig()
            {
                AvailableIntervalStart = new LocalDate(2021, 1, 1),
                AvailableIntervalEnd   = new LocalDate(2021, 12, 31),
            });

            db !.Slots.Add(new AppointmentSlot()
            {
                From        = new LocalDateTime(2021, 5, 1, 10, 0),
                Duration    = Period.FromHours(1),
                CountOfSlot = 1,
            });
            await db !.SaveChangesAsync();

            var aggregatesForMonth = await sut !.SearchAppointmentsByYearMonthAsync(new YearMonth(2021, 5));

            Assert.IsTrue(aggregatesForMonth.Appointments.First(e => e.Date == new LocalDate(2021, 5, 1)).AllSlots.Any());
            Assert.AreEqual(new LocalDateTime(2021, 5, 1, 10, 0), aggregatesForMonth.Appointments.First(e => e.Date == new LocalDate(2021, 5, 1)).AllSlots.First().From);
            Assert.IsFalse(aggregatesForMonth.Appointments.First(e => e.Date == new LocalDate(2021, 5, 1)).AllSlots.First().Appointments.Any());
        }
Exemplo n.º 25
0
 //印出棋盤
 public void Print()
 {
     for (var y = 1; y <= GRID_SIZE; y++)
     {
         for (var x = 1; x <= GRID_SIZE; x++)
         {
             var pos = x * DIG_SHIFT + y;
             if (QueenPositions.Contains(pos))
             {
                 Console.ForegroundColor = ConsoleColor.Red;
             }
             else
             {
                 Console.ForegroundColor =
                     Slots.Contains(pos) ? ConsoleColor.White : ConsoleColor.Yellow;
             }
             Console.Write("█ ");
         }
         Console.WriteLine();
     }
     Console.ResetColor();
 }
Exemplo n.º 26
0
        public List <Item> UnequipWeapon()
        {
            var weapon = new List <Item>();

            var mh = Slots.First(s => s.Type == EquipmentSlotType.MainHand).Item;

            if (!mh.IsEmpty)
            {
                weapon.Add(mh);
                Unequip(mh);
            }

            var oh = Slots.First(s => s.Type == EquipmentSlotType.OffHand).Item;

            if (!oh.IsEmpty)
            {
                weapon.Add(oh);
                Unequip(oh);
            }

            return(weapon);
        }
Exemplo n.º 27
0
        public void DispenseSoldOutTest()
        {
            //Arrange
            VendingMachine testVend = new VendingMachine
            {
                Balance = 5
            };

            testVend.Load();
            Slots testSlot = new Slots("A1")
            {
                Amount = 0
            };

            //Act

            testVend.Dispense(testSlot);

            //Assert
            Assert.AreEqual(testSlot.Amount  = 0, testSlot.Amount);
            Assert.AreEqual(testVend.Balance = 5, testVend.Balance);
        }
Exemplo n.º 28
0
        public BocsNodeTexture()
        {
            NodeTitle = "Image Texture";
            NodeName  = "image_texture";

            //Outputs...
            Slots.Add(new BocsSlotClosure(this, "Color", "color", BocsSlotBase.BocsSlotType.Output));
            Slots.Add(new BocsSlotClosure(this, "Alpha", "alpha", BocsSlotBase.BocsSlotType.Output));

            //Options...
            Slots.Add(new BocsSlotTexture(this, "Image", "filename", BocsSlotBase.BocsSlotType.Value));

            BocsSlotStringList bsl = new BocsSlotStringList(this, "color_space", "color_space", BocsSlotBase.BocsSlotType.Value, 1);

            bsl.List = new string[] { "none", "color" };
            Slots.Add(bsl);

            Slots.Add(new BocsSlotBool(this, "Use Alpha", "use_alpha", BocsSlotBase.BocsSlotType.Value, true));

            BocsSlotStringList bsl1 = new BocsSlotStringList(this, "interpolation", "interpolation", BocsSlotBase.BocsSlotType.Value, 1);

            bsl1.List = new string[] { "closest", "linear", "cubic", "smart" };
            Slots.Add(bsl1);

            BocsSlotStringList bsl2 = new BocsSlotStringList(this, "extension", "extension", BocsSlotBase.BocsSlotType.Value, 0);

            bsl2.List = new string[] { "periodic", "clamp", "black" };
            Slots.Add(bsl2);

            BocsSlotStringList bsl3 = new BocsSlotStringList(this, "projection", "projection", BocsSlotBase.BocsSlotType.Value, 0);

            bsl3.List = new string[] { "flat", "box", "sphere", "tube" };
            Slots.Add(bsl3);

            //_slots.Add(new BocsSlotFloat(this,"Blend","projection_blend",BocsSlotBase.BocsSlotType.Value,0));

            //Inputs...
            Slots.Add(new BocsSlotClosure(this, "Vector", "vector", BocsSlotBase.BocsSlotType.Input));
        }
Exemplo n.º 29
0
        private bool StartCookingProcessWithFoodTray(string menuText, string[] menuPath, Recipe.MealDestination destination, Recipe.MealQuantity quantity, Recipe.MealRepetition repetition)
        {
            List <Ingredient> ingredientsUsed = new List <Ingredient>();

            if (!this.Actor.IsNPC && !AniRecipe.UseUpIngredientsFrom(this.ChosenRecipe, this.Actor, ref ingredientsUsed, quantity, false))
            {
                return(false);
            }
            this.Actor.SkillManager.AddElement(SkillNames.Cooking);
            FoodTray foodTray = (FoodTray)GlobalFunctions.CreateObject("FoodTray", Vector3.OutOfWorld, 0, Vector3.UnitZ);

            foodTray.CookingProcess = new CookingProcess(this.ChosenRecipe, ingredientsUsed, this.Target, this.Target.LotCurrent, destination, quantity, repetition, menuText, menuPath, foodTray, this.Actor);
            foodTray.CreateFoodProp(Slots.Hash("Slot_0"), foodTray.CookingProcess.Recipe.ModelsAndMaterials.GrillModel_FoodTray);
            CookingProcess.MoveToNextStep(foodTray, this.Actor);
            CookingProcess.MoveToNextStep(foodTray, this.Actor);
            CookingProcess.MoveToNextStep(foodTray, this.Actor);
            StateMachineClient stateMachineClient = StateMachineClient.Acquire(this.Actor.Proxy.ObjectId, "Grill");

            if (stateMachineClient == null)
            {
                return(false);
            }
            stateMachineClient.AddInterest <TraitNames>(TraitNames.Clumsy);
            stateMachineClient.SetActor("x", this.Actor);
            stateMachineClient.SetActor("FoodTray", foodTray);
            stateMachineClient.EnterState("x", "Enter - Hands Empty");
            stateMachineClient.RequestState("x", "Take Out Food Tray");
            stateMachineClient.RequestState("x", "Exit - Holding Food Tray");
            if (this.Actor.HasExitReason(ExitReason.Canceled))
            {
                CarrySystem.EnterWhileHolding(this.Actor, foodTray);
                Food.PutHeldObjectDownOnCounterTableOrFloor(this.Actor, SurfaceType.Normal);
                return(false);
            }
            CarrySystem.EnterWhileHolding(this.Actor, foodTray);
            InteractionInstance instance = FoodTray_Prepare.Singleton.CreateInstance(foodTray, this.Actor, this.Actor.InheritedPriority(), base.Autonomous, true);

            return(this.Actor.InteractionQueue.PushAsContinuation(instance, true));
        }
Exemplo n.º 30
0
        public void InsertUpdateUnit(Unit unit)
        {
            if (unit.BattleRole == null)
            {
                return;
            }

            Slot currentSlot = Slots.Where(x => x.BattleRole.Name == unit.BattleRole.Name).Distinct().First();

            if (currentSlot != null && currentSlot.CreatedUnits != null && currentSlot.CreatedUnits.Any(x => x.Id.Equals(unit.Id)))
            {
                Unit existingUnit = currentSlot.CreatedUnits.Where(y => y.Id.Equals(unit.Id)).Distinct().First();
                if (existingUnit != null)
                {
                    existingUnit = unit;
                }
            }
            else
            {
                currentSlot.CreatedUnits.Add(unit);
            }
        }
Exemplo n.º 31
0
        public async Task CreateMultipleAppointmentSlotsAsync_should_return_ok()
        {
            var result = await sut !.CreateMultipleAppointmentSlotsAsync(new List <LocalDate>()
            {
                new LocalDate(2021, 5, 1)
            }, new LocalTime(10, 0), Period.FromHours(1), 1, 2);

            Assert.IsTrue(result.Succeeded);

            var slots = await db !.Slots.OrderBy(d => d.From).ToListAsync();
            var slot1 = slots.First();

            Assert.AreEqual(new LocalDateTime(2021, 5, 1, 10, 0), slot1.From);
            Assert.AreEqual(Period.FromHours(1), slot1.Duration);
            Assert.AreEqual(1, slot1.CountOfSlot);

            var slot2 = slots.Last();

            Assert.AreEqual(new LocalDateTime(2021, 5, 1, 11, 0), slot2.From);
            Assert.AreEqual(Period.FromHours(1), slot2.Duration);
            Assert.AreEqual(1, slot2.CountOfSlot);
        }
Exemplo n.º 32
0
    /// <summary>
    /// Returns the score of the select position; determinds if it is a bad or good move
    /// </summary>
    /// <param name="currentBoard">Active board</param>
    /// <param name="player">Active user</param>
    /// <returns>Score</returns>
    int MinMax(Board currentBoard, Slots player)
    {
        Slots[] board = currentBoard.GetBoard();

        //How is the position like for player (their turn) on board?
        Slots winner = Win(currentBoard);

        if (winner != 0)
        {
            return(winner * player);
        }

        int move  = -1;
        int score = -2; //Losing moves are preferred to no move

        for (int i = 0; i < 9; ++i)
        {
            //For all moves,
            if (board[i] == Slots.Blank)
            {
                //If legal,
                board[i] = player; //Try the move

                int thisScore = -MinMax(currentBoard, player * -1);
                if (thisScore > score)
                {
                    score = thisScore;
                    move  = i;
                } //Pick the one that's worst for the opponent

                board[i] = 0; //Reset board after try
            }
        }
        if (move == -1)
        {
            return(0);
        }
        return(score);
    }
Exemplo n.º 33
0
 private void Inherit(VTable parent, Dictionary <VTableSignature, List <VTableSlot> > slotDict)
 {
     foreach (VTableSlot slot in parent.Slots)
     {
         List <VTableSlot> slotList;
         if (slotDict.TryGetValue(slot.Signature, out slotList))
         {
             if (slotList.Count > 0)
             {
                 if (slotList.All(baseSlot => baseSlot.MethodDef.DeclaringType.IsInterface))
                 {
                     // Base slot is interface method => add together
                     if (!slotList.Any(baseSlot =>
                                       baseSlot.Signature == slot.Signature &&
                                       new SigComparer().Equals(baseSlot.DeclaringType, slot.DeclaringType)))
                     {
                         slotList.Add(slot);
                         Slots.Add(slot);
                     }
                 }
                 else
                 {
                     throw new UnreachableException();
                 }
             }
             else
             {
                 slotList.Add(slot);
                 Slots.Add(slot);
             }
         }
         else
         {
             slotDict.AddListEntry(slot.Signature, slot);
             Slots.Add(slot);
         }
     }
 }
Exemplo n.º 34
0
        public Game ChooseGame(Person player)
        {
            Game   game;
            string choice = "";

            do
            {
                Console.WriteLine("What game would you like to play? BlackJack, Slots, Craps, Go Fish, or War?");
                choice = Console.ReadLine().ToLower();
                if (choice == "blackjack" || choice == "black jack")
                {
                    game = new BlackJackGame(player);
                }
                else if (choice == "go fish" || choice == "gofish")
                {
                    game = new GoFishGame(player);
                }
                else if (choice == "war")
                {
                    game = new War(player);
                }
                else if (choice == "craps")
                {
                    game = new Craps(player);
                }
                else if (choice == "slots")
                {
                    game = new Slots(player);
                }
                else
                {
                    game = null;
                }
            } while(choice != "blackjack" && choice != "black jack" && choice != "go fish" && choice != "gofish" && choice != "war" &&
                    choice != "slots" && choice != "craps");
            Console.WriteLine("Going to " + choice + "!");
            return(game);
        }
Exemplo n.º 35
0
		void Buy( UInt64 guid, int num, Slots slot, byte n )
		{
			Mobile from = account.FindMobileByGuid( guid );
			if ( from == null )
				return;
			if ( from is BaseCreature )
			{
				( from as BaseCreature ).SpeakingFrom = DateTime.Now;
				( from as BaseCreature ).AIState = AIStates.Speaking;
			}
			Item it = null;
			foreach( Item isell in from.Sells )
				if ( isell.Id == num )
				{
					it = isell;
					break;
				}
			if ( it == null )
				return;
			if ( slot != Slots.None && (int)slot < 25 && ( !CanEquip( it ) || it.CanBeEquipedIn != slot ) )
			{
				InventoryFailed( 3, it.Guid );
				return;
			}
			it = it.Clone();
			if ( /*account.AccessLevel == Account.AccessLevels.PlayerLevel*/true )
			{
				if ( it.BuyPrice > Copper )
				{
					InventoryFailed( 28, it.Guid );
					return;
				}
				Copper -= (uint)it.BuyPrice;
			}
			int amount = 1;
			if ( it.InventoryType == InventoryTypes.Projectile )
				amount = it.Stackable;
			if ( slot != Slots.None && Items[ (int)slot ] != null )
				PutObjectInBackpack( it, amount, Slots.None, true );
			else
				PutObjectInBackpack( it, amount, (Slots)slot, true );
		}
Exemplo n.º 36
0
		public bool PutObjectInBackpack( Item it, int n, Slots at, bool refresh )
		{
			bool put = false;
			if ( at == Slots.None || Items[ (int)at ] != null )
			{
				put = true;
				at = FindAFreeSlot();
			}
			if ( at == Slots.None )
			{
				this.InventoryFailed( 27 );
				return false;
			}
			if ( n == 0 && it.Stackable > 1 )
				it.MaxCount = it.Stackable;
			else
				it.MaxCount = n;
			//	on verifi les quetes en cours pour les deliveries
			CheckDeliveries( it );

			if ( put )
			{
				foreach( Item i in Items )
				{
					if ( i != null && i.Id == it.Id && i.MaxCount + it.MaxCount <= i.Stackable )
					{
						i.MaxCount += n;
						if ( refresh && account != null )
							i.SendTinyUpdate( new int[]{14}, new object[]{ i.MaxCount }, this );
						return true;
					}
				}
			}
			Items[ (int)at ] = it;
			if ( refresh && account != null )
			{
				int offset = 0;
				Converter.ToBytes( 1, tempBuff, ref offset );
				Converter.ToBytes( (byte)0, tempBuff, ref offset );

				it.PrepareUpdateData( tempBuff, ref offset, UpdateType.UpdateFull, this );	
				//ItemsUpdate( tempBuff, ref offset );				

				byte []res = Zip.Compress( tempBuff, 0, offset );
				byte []data = new byte[ res.Length + 8 ];
				Buffer.BlockCopy( res, 0, data, 8, res.Length );
				int t = 4;
				Converter.ToBytes( (int)offset, data, ref t );
				account.Handler.Send( 0x1F6, data, res.Length + 6 );
				ItemsUpdate( new int[] { (int)at } );
			}
			return true;
		}
Exemplo n.º 37
0
		public void DestroyItem( Slots it, bool deleteAfter )
		{
			if ( this.AttackTarget != null )
				this.StopAttacking();
			if ( deleteAfter )
				DestroyObject( Items[ (int)it ].Guid );

			if ( (int)it < 24 + 16 )
			{
				int offset = 4;
				Converter.ToBytes( (short)1, tempBuff, ref offset );
				Converter.ToBytes( (int)0, tempBuff, ref offset );
				Converter.ToBytes( Guid, tempBuff, ref offset );
				//Converter.ToBytes( (byte)0x1C, tempBuff, ref offset );
				ResetBitmap();

				int last = 1;
				if ( (int)it < 24 )
					setUpdateValue( last = (int)UpdateFields.PLAYER_VISIBLE_ITEM_1_0 + (int)it * 12, 0 );
				setUpdateValue( last = (int)UpdateFields.PLAYER_FIELD_INV_SLOT_HEAD + ( 2 * (int)it ), (UInt64)0  );
				FlushUpdateData( tempBuff, ref offset, 2 + ( last / 32 ) );//0, 0, 0 );
				account.Handler.Send( 0xA9, tempBuff, offset );	
				if ( (int)it < 19 )
					account.ToAllPlayerNearExceptMe( OpCodes.SMSG_UPDATE_OBJECT, tempBuff, offset );
			}
			else
			{
				int ex = 0;
				Item c = RealSlot( (int)it, ref ex );
				int offset = 4;
				Converter.ToBytes( (short)1, tempBuff, ref offset );
				Converter.ToBytes( (int)0, tempBuff, ref offset );
				Converter.ToBytes( c.Guid, tempBuff, ref offset );
				ResetBitmap();
				setUpdateValue( (int)UpdateFields.CONTAINER_FIELD_SLOT_1 + ( 2 * ex ), (UInt64)0  );
				FlushUpdateData( tempBuff, ref offset, 3 );
				account.Handler.Send( 0xA9, tempBuff, offset );	
			}
			Items[ (int)it ] = null;
		}
Exemplo n.º 38
0
		public void AutoEquip( Slots from )
		{
			if ( AttackTarget != null )
				StopAttacking();
			Item i = Items[ (int)from ];
			if ( i == null )
			{
				Console.WriteLine("Item in {0} missing", (int)from );
				return;
			}
				
			Slots where = i.CanBeEquipedIn;
			if ( i.IsContainer )
			{
				where = Slots.None;
				for( int t = 19;t < 23;t++ )
					if ( Items[ t ] == null )
					{
						where = (Slots)t;
						break;
					}
				if ( where == Slots.None )
				{
					InventoryFailed( 17, i.Guid );
					return;
				}
			}
			else
			{
				if ( where == Slots.OffHand )
				{
					if ( i.IsWeapon && !HaveSpell( 674 ) )
					{
						InventoryFailed( 7, i.Guid );
						return;
					}
				}
				if ( !CanEquip( i ) )
					return;			
			}
			if ( where != Slots.None )
				SwapInv( from, where );
		}
Exemplo n.º 39
0
		public void Autostore( Slots from, byte s )
		{
			if ( AttackTarget != null )
				StopAttacking();
			Slots where = FindAFreeSlot( s );
			if ( where == Slots.None )
			{//	that bag is full
				InventoryFailed( 51, Items[ (int)from ].Guid );
				return;
			}
			SwapInv( (Slots)from, where );
		}
Exemplo n.º 40
0
		public void SwapInv( Slots from, Slots to )
		{
			if ( AttackTarget != null )
				StopAttacking();
			if ( Dead )
			{
				if ( to != Slots.None && from != Slots.None )
				{
					Item i = Items[ (int)to ];
					Item f = Items[ (int)from ];
					if ( i != null && f != null )
						InventoryFailed( 36 , i.Guid, f.Guid );
					else
						if ( i != null )
						InventoryFailed( 36 , i.Guid );
					else
						InventoryFailed( 36 , f.Guid );
				}
				else
					if ( to != Slots.None && from == Slots.None )
				{
					Item i = Items[ (int)to ];
					if ( i != null )
						InventoryFailed( 36 , i.Guid );
				}
				else
					if ( to == Slots.None && from != Slots.None )
				{
					Item f = Items[ (int)from ];
					if ( f != null )
						InventoryFailed( 36 , f.Guid );
				}
				return;
			}
			if ( Items[ (int)to ] != null )
			{
				Item i = Items[ (int)to ];
				Item f = Items[ (int)from ];
				if ( (int)to >18 && (int)to < 23 )
				{
					int d = 40 + ( (int)to - 19 ) * 16;
					for(int t = d;t < d + 16;t++ )
						if ( Items[ t ] != null )
						{
							InventoryFailed( 30 , i.Guid, f.Guid );
							return;
						}
				}
				if ( (int)from >18 && (int)from < 23 )
				{
					int d = 40 + ( (int)from - 19 ) * 16;
					for(int t = d;t < d + 16;t++ )
						if ( Items[ t ] != null )
						{
							InventoryFailed( 30 , i.Guid, f.Guid );
							return;
						}
				}
				if ( (int)to < 19 )
				{
					if ( !CanEquip( f, i ) )
						return;
				}
				if ( (int)from < 19 )
				{
					if ( !CanEquip( i, f ) )
						return;
				}				
				if ( i.Id == f.Id )
				{
					if ( i.MaxCount + f.MaxCount <= i.Stackable )
					{
						i.MaxCount += f.MaxCount;
						i.SendTinyUpdate( new int[] { 14 }, new object[] { i.MaxCount }, this );
						DestroyItem( from, true );						
						return;
					}
					else
						if ( i.MaxCount < i.Stackable )
					{
						int d = i.Stackable - i.MaxCount;
						i.MaxCount = i.Stackable;
						f.MaxCount -= d;
						i.SendTinyUpdate( new int[] { 14 }, new object[] { i.MaxCount }, this );
						f.SendTinyUpdate( new int[] { 14 }, new object[] { f.MaxCount }, this );
					}
					else
					{
						Items[ (int)to ] = f;
						Items[ (int)from ] = i;
					}
				}				
				else
				{
					Items[ (int)to ] = f;
					Items[ (int)from ] = i;
				}
				ItemsUpdate( new int[] { (int)from, (int)to } );
				if ( (int)to < 19 || (int)from < 19 )				
					foreach( Character c in account.PlayersNear )
						if ( c.Player.PlayersNear.Contains( this ) )
							ItemsUpdateForOther( c.Player.Handler );
				
			}
			else
			{
				if ( (int)from >18 && (int)from < 23 )
				{
					int d = 40 + ( (int)from - 19 ) * 16;
					for(int t = d;t < d + 16;t++ )
						if ( Items[ t ] != null )
						{
							InventoryFailed( 30 , Items[ (int)from ].Guid );
							return;
						}
				}
				if ( (int)from < 19 )
				{
					if ( !CanEquip( Items[ (int)from ] ) )
						return;
				}
				if ( (int)to < 19 )
				{					
				//	Item i = Items[ (int)to ];
					Item f = Items[ (int)from ];
					if ( to == Slots.OffHand )
					{
						if ( f.IsWeapon && !HaveSpell( 674 ) )
						{
							InventoryFailed( 7, f.Guid );
							return;
						}
					}
					if ( f != null )
					{
						if ( to == Slots.OffHand )
						{
							if ( f.IsWeapon && !HaveSpell( 674 ) )
							{
								InventoryFailed( 7, f.Guid );
								return;
							}
						}
						if ( !CanEquip( f ) )
						{
							return;
						}
					}
				}
				Items[ (int)to ] = Items[ (int)from ];
				DestroyItem( from, false );
				ItemsUpdate( new int[] { (int)from, (int)to } );
				if ( (int)to < 19 || (int)from < 19 )
					foreach( Character c in account.PlayersNear )
						if ( c.Player.PlayersNear.Contains( this ) )
							ItemsUpdateForOther( c.Player.Handler );
			}
		}
Exemplo n.º 41
0
 private void repromptForMajor()
 {
     RecoManager.Instance.Say("I do not have information for that major.");
      expecting = Slots.Major;
 }
Exemplo n.º 42
0
 public void repromptForGradYear()
 {
     RecoManager.Instance.Say("Ok When are you planning on graduating?");
      expecting = Slots.GradYear;
 }
Exemplo n.º 43
0
 public TimeSlot(Slots.Slot slot)
 {
     Slot = slot;
     Sessions = new Dictionary<int, Sessions.Session>();
 }
Exemplo n.º 44
0
 public void StartInteraction()
 {
     RecoManager.Instance.SetGrammarMode(GrammarModes.IntroductionGrammar);
      RecoManager.Instance.StartSpeechReco();
      RecoManager.Instance.Say("Welcome to the MyPack Degree Planner. Before we begin, I need to know a little bit about you.");
      RecoManager.Instance.Say("What is your intended major?");
      expecting = Slots.Major;
 }
Exemplo n.º 45
0
 public void promptForGradYear()
 {
     RecoManager.Instance.Say("Excellent choice! When are you planning on graduating?");
      expecting = Slots.GradYear;
 }
Exemplo n.º 46
0
		public Item FindItemById( int id, out Slots slot )
		{
			slot = Slots.None;
			int t = 0;
			foreach( Item i in Items )
			{
				if ( i != null && i.Id == id )
				{
					slot = (Slots)t;
					return i;
				}
				t++;
			}
			return null;
		}
Exemplo n.º 47
0
		public void TradeItem( int num, Slots from )
		{
			tradeItems[ num ] = (int)from;
			TradeUpdate();			
		}
Exemplo n.º 48
0
 private void confirmGradYear()
 {
     RecoManager.Instance.Say("Ok, I'll set your graduation date to " + GradYear);
      RecoManager.Instance.Say("Is this correct?");
      expecting = Slots.YesNo;
 }