示例#1
0
    // Use this for initialization
    void Start()
    {
        bagHandler = GetComponent <BagHandler>();

//        // when using in conjunction with a pinch or rotation recognizer setting the min touches to 2 smoothes movement greatly
//        if( Application.platform == RuntimePlatform.IPhonePlayer ) {
//            recognizer.minimumNumberOfTouches = 2;
//        }

        // continuous gestures have a complete event so that we know when they are done recognizing
        swipeRecognizer.gestureRecognizedEvent += swipeGestureDetected;
        TouchKit.addGestureRecognizer(swipeRecognizer);

        twoTapRecognizer.numberOfTouchesRequired = 2;
        twoTapRecognizer.gestureRecognizedEvent += twoTapDetected;
        TouchKit.addGestureRecognizer(twoTapRecognizer);

/*
 #if UNITY_IOS
 *      Input.simulateMouseWithTouches = false;
 #endif
 #if UNITY_IOS || UNITY_ANDROID
 *      tapRecognizer.numberOfTouchesRequired = 1;
 *      tapRecognizer.gestureRecognizedEvent += tapDetected;
 *      TouchKit.addGestureRecognizer(tapRecognizer);
 #endif
 */

        continousHoldRecognizer.gestureHoldingEvent      += touchHoldActive;
        continousHoldRecognizer.gestureHoldingEventEnded += touchHoldEnded;
        TouchKit.addGestureRecognizer(continousHoldRecognizer);

        StartCoroutine(preloadGameObjects());
    }
    // Use this for initialization
    void Start()
    {
        BagHandler.instance = this;

        PubSub.subscribe("Click", this);

        BAG_CONTENTS_LAYER_MASK = LayerMask.GetMask(new string[] { "BagContentRootObject" });
    }
    public void startPlaceBags(BagHandler bagHandler, Vector3 bagDropPosition)
    {
        // TODO - each instantiated item should have a ruleset on if it prefers tray or not, and if max one can be instantiated per person...
        StartCoroutine(startPlaceBagsCoroutine(bagHandler, bagDropPosition));

        if (toBePlacedInTrays.Count > 0)
        {
            // TODO - Create tray with items (after delay)
//            BagHandler.instance.createTrayWithContents(Game.instance.getTrayDropPosition(), manualInspectItems);
        }
    }
示例#4
0
        public override string Part1(string input)
        {
            var bags = new BagHandler();

            foreach (var line in input.Lines())
            {
                bags.AddBag(line);
            }

            return(bags.BagContains("shiny gold").Count.ToString());
        }
示例#5
0
        public override string Part2(string input)
        {
            var bags = new BagHandler();

            foreach (var line in input.Lines())
            {
                bags.AddBag(line);
            }

            return(bags.BagInsides("shiny gold").Sum(x => x.Value).ToString());
        }
示例#6
0
 public GameSocket(ISerializer serializer) : base(serializer)
 {
     _bagHandler           = new BagHandler(this);
     _battleHandler        = new BattleHandler(this);
     _dailyActivityHandler = new DailyActivityHandler(this);
     _equipHandler         = new EquipHandler(this);
     _itemHandler          = new ItemHandler(this);
     _messageHandler       = new MessageHandler(this);
     _npcHandler           = new NpcHandler(this);
     _petHandler           = new PetHandler(this);
     _petNewHandler        = new PetNewHandler(this);
     _playerHandler        = new PlayerHandler(this);
     _prepaidHandler       = new PrepaidHandler(this);
     _resourceHandler      = new ResourceHandler(this);
     _skillHandler         = new SkillHandler(this);
     _skillKeysHandler     = new SkillKeysHandler(this);
     _taskHandler          = new TaskHandler(this);
     _teamHandler          = new TeamHandler(this);
     _entryHandler         = new EntryHandler(this);
     _roleHandler          = new RoleHandler(this);
 }
 public IEnumerator startPlaceBagsCoroutine(BagHandler bagHandler, Vector3 bagDropPosition)
 {
     yield return(bagHandler.packBagAndDropIt(bagDropPosition, bagDefinition, toBePlacedInTrays, this));
 }
示例#8
0
 public GameSocket(ISerializer serializer) : base(serializer)
 {
     _achievementHandler       = new AchievementHandler(this);
     _activityHandler          = new ActivityHandler(this);
     _activityFavorHandler     = new ActivityFavorHandler(this);
     _amuletHandler            = new AmuletHandler(this);
     _arenaHandler             = new ArenaHandler(this);
     _attendanceHandler        = new AttendanceHandler(this);
     _bagHandler               = new BagHandler(this);
     _battleHandler            = new BattleHandler(this);
     _cardHandler              = new CardHandler(this);
     _consignmentLineHandler   = new ConsignmentLineHandler(this);
     _crossServerHandler       = new CrossServerHandler(this);
     _dailyActivityHandler     = new DailyActivityHandler(this);
     _demonTowerHandler        = new DemonTowerHandler(this);
     _equipHandler             = new EquipHandler(this);
     _exchangeHandler          = new ExchangeHandler(this);
     _fashionHandler           = new FashionHandler(this);
     _fightLevelHandler        = new FightLevelHandler(this);
     _fleeHandler              = new FleeHandler(this);
     _friendHandler            = new FriendHandler(this);
     _functionHandler          = new FunctionHandler(this);
     _functionOpenHandler      = new FunctionOpenHandler(this);
     _giftOnlineHandler        = new GiftOnlineHandler(this);
     _goddessHandler           = new GoddessHandler(this);
     _guildBlessHandler        = new GuildBlessHandler(this);
     _guildBossHandler         = new GuildBossHandler(this);
     _guildDepotHandler        = new GuildDepotHandler(this);
     _guildHandler             = new GuildHandler(this);
     _guildShopHandler         = new GuildShopHandler(this);
     _guildTechHandler         = new GuildTechHandler(this);
     _hookSetHandler           = new HookSetHandler(this);
     _interactHandler          = new InteractHandler(this);
     _intergalMallHandler      = new IntergalMallHandler(this);
     _itemHandler              = new ItemHandler(this);
     _leaderBoardHandler       = new LeaderBoardHandler(this);
     _limitTimeActivityHandler = new LimitTimeActivityHandler(this);
     _mailHandler              = new MailHandler(this);
     _mapHandler               = new MapHandler(this);
     _masteryHandler           = new MasteryHandler(this);
     _medalHandler             = new MedalHandler(this);
     _messageHandler           = new MessageHandler(this);
     _mountHandler             = new MountHandler(this);
     _npcHandler               = new NpcHandler(this);
     _offlineAwardHandler      = new OfflineAwardHandler(this);
     _onlineGiftHandler        = new OnlineGiftHandler(this);
     _payGiftHandler           = new PayGiftHandler(this);
     _petHandler               = new PetHandler(this);
     _petNewHandler            = new PetNewHandler(this);
     _playerHandler            = new PlayerHandler(this);
     _prepaidHandler           = new PrepaidHandler(this);
     _rankHandler              = new RankHandler(this);
     _resourceDungeonHandler   = new ResourceDungeonHandler(this);
     _resourceHandler          = new ResourceHandler(this);
     _rewardHandler            = new RewardHandler(this);
     _saleHandler              = new SaleHandler(this);
     _shopMallHandler          = new ShopMallHandler(this);
     _skillHandler             = new SkillHandler(this);
     _skillKeysHandler         = new SkillKeysHandler(this);
     _soloHandler              = new SoloHandler(this);
     _stealHandler             = new StealHandler(this);
     _sysSetHandler            = new SysSetHandler(this);
     _taskHandler              = new TaskHandler(this);
     _teamHandler              = new TeamHandler(this);
     _tradeHandler             = new TradeHandler(this);
     _treasureHandler          = new TreasureHandler(this);
     _upLevelHandler           = new UpLevelHandler(this);
     _vipHandler               = new VipHandler(this);
     _vitalityHandler          = new VitalityHandler(this);
     _wingHandler              = new WingHandler(this);
     _activityRevelryHandler   = new ActivityRevelryHandler(this);
     _auctionHandler           = new AuctionHandler(this);
     _chatHandler              = new ChatHandler(this);
     _daoYouHandler            = new DaoYouHandler(this);
     _entryHandler             = new EntryHandler(this);
     _roleHandler              = new RoleHandler(this);
     _farmHandler              = new FarmHandler(this);
     _five2FiveHandler         = new Five2FiveHandler(this);
     _guildManagerHandler      = new GuildManagerHandler(this);
     _xianYuanHandler          = new XianYuanHandler(this);
 }