protected override LoopListViewItem2 OnGetItemByIndex(LoopListView2 listView, int index)
    {
        if (index < 0 || index >= DataManger.TotalItemCount)
        {
            return(null);
        }
        GridItemData itemData = DataManger.GetItemDataByIndex(index);

        if (itemData == null)
        {
            return(null);
        }
        LoopListViewItem2 item = listView.NewListViewItem(ItemName);

        for (int i = 0; i < row; i++)
        {
            int             itemIndex  = index * row + i;
            UIGameLevelItem itemScript = item.transform.GetChild(i).GetComponent <UIGameLevelItem>();
            if (itemIndex >= DataManger.TotalDataCount)
            {
                itemScript.gameObject.SetActive(false);
                continue;
            }
            else
            {
                itemScript.gameObject.SetActive(true);
            }
            itemScript.Init();
            m_TransferDataList[itemIndex].ActionOneIntCallBack = CallBack;
            m_TransferDataList[itemIndex].ObjArray             = new object[] { itemScript };
            itemScript.SetData(m_TransferDataList[itemIndex]);
        }
        return(item);
    }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.ViewChallengeList);

            prefHelper  = new PreferenceHelper(this);
            dataManager = new DataManger(this);

            var recyclerView  = FindViewById <RecyclerView>(Resource.Id.recyclerView);
            var toolbar       = FindViewById <Android.Widget.Toolbar>(Resource.Id.toolbar);
            var addItemButton = FindViewById <com.refractored.fab.FloatingActionButton>(Resource.Id.addItemButton);

            SetActionBar(toolbar);
            ActionBar.Title = "Check It";
            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetHomeButtonEnabled(true);

            var layoutManager = new LinearLayoutManager(this, LinearLayoutManager.Vertical, false);

            recyclerView.SetLayoutManager(layoutManager);

            //Get challenges from database
            challenges = dataManager.ChallangeData.GetChallanges();

            adapter = new ChallengeAdapter(this, challenges.Where(w => !w.IsCompleted).ToList());

            recyclerView.SetAdapter(adapter);

            adapter.ItemClick   += Challenge_ItemClick;
            addItemButton.Click += AddItemButton_Click;
        }
    protected override LoopListViewItem2 OnGetItemByIndex(LoopListView2 listView, int index)
    {
        if (index < 0 || index >= DataManger.TotalItemCount)
        {
            return(null);
        }
        GridItemData itemData = DataManger.GetItemDataByIndex(index);

        if (itemData == null)
        {
            return(null);
        }
        LoopListViewItem2 item = listView.NewListViewItem(ItemName);

        EquipItem itemScript = item.GetComponent <EquipItem>();

        itemScript.Init();
        itemScript.SetData(index, UnityEngine.Random.Range(1, 6), SpriteArray[UnityEngine.Random.Range(0, SpriteArray.Length)].name, UnityEngine.Random.Range(0, 2) == 1,
                           UnityEngine.Random.Range(1, 1000), UnityEngine.Random.Range(1, 6));
        itemScript.GetComponent <Button>().onClick.RemoveAllListeners();
        itemScript.GetComponent <Button>().onClick.AddListener(delegate
        {
            Debug.Log(itemScript.Index);
        });

        return(item);
    }
Exemple #4
0
 /**
  * Static constructor.
  */
 static EventUtils()
 {
     m_mainScript            = GameObject.Find("ScriptHub").GetComponent <Main>();
     m_agentScript           = GameObject.Find("Agent").GetComponent <AgentInput>();
     m_sessionScript         = GameObject.Find("ScriptHub").GetComponent <SessionBehavior>();
     m_ballScript            = GameObject.Find("Ball").GetComponent <BallBehavior>();
     m_dataScript            = GameObject.Find("ScriptHub").GetComponent <DataManger>();
     m_ballObservationScript = GameObject.Find("Ball").GetComponent <BallObservation>();
 }
Exemple #5
0
        public override Dialog OnCreateDialog(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Begin building a new dialog.
            var builder = new AlertDialog.Builder(Activity);

            //Get the layout inflater
            var inflater = Activity.LayoutInflater;



            //Inflate the layout for this dialog
            var dialogView = inflater.Inflate(Resource.Layout.DialogAddNewChallenge, null);

            dataManager = new DataManger(dialogView.Context);

            frequencies = dataManager.ChallangeData.GetPredefinedFrequencies();


            var adapter = new ArrayAdapter <Frequency>(dialogView.Context, Android.Resource.Layout.SimpleSpinnerItem, frequencies);

            adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            spinner      = dialogView.FindViewById <MaterialSpinner>(Resource.Id.spinner);
            manualLayout = dialogView.FindViewById <LinearLayout>(Resource.Id.manualLayout);
            switchOption = dialogView.FindViewById <Switch>(Resource.Id.switchOption);
            var yesBtn = dialogView.FindViewById <Button>(Resource.Id.yesBtn);
            var noBtn  = dialogView.FindViewById <Button>(Resource.Id.noBtn);

            days            = dialogView.FindViewById <EditText>(Resource.Id.days);
            seekBarDuration = dialogView.FindViewById <SeekBar>(Resource.Id.seekBarDuration);
            durationText    = dialogView.FindViewById <TextView>(Resource.Id.durationText);
            challengeName   = dialogView.FindViewById <EditText>(Resource.Id.challengeName);
            selectDateBtn   = dialogView.FindViewById <ImageButton>(Resource.Id.pickDateBtn);
            dateEditText    = dialogView.FindViewById <EditText>(Resource.Id.dateEditText);



            seekBarDuration.Max = 100 - 1;
            spinner.Adapter     = adapter;

            switchOption.CheckedChange += SwitchOption_CheckedChange;
            yesBtn.Click += YesBtn_Click;
            noBtn.Click  += NoBtn_Click;
            seekBarDuration.ProgressChanged += SeekBarDuration_ProgressChanged;
            selectDateBtn.Click             += _dateSelectButton_Click;

            manualLayout.Visibility = ViewStates.Gone;

            builder.SetView(dialogView);
            var dialog = builder.Create();

            return(dialog);
        }
Exemple #6
0
    public static void Main(string[] args)
    {
        var sourceUrl  = args[0];
        var resultPath = args[2];

        var dataManager = new DataManger();
        var content     = dataManager.GetPack(sourceUrl);

        var generator = new Generator();
        var result    = generator.processContent(content);

        Packer.pack(result, resultPath);
    }
Exemple #7
0
 /**
  * Static constructor.
  */
 public static void InitGeneralUtils()
 {
     BallUtils.InitBallUtilities();
     NetUtils.InitNetUtils();
     m_mainScript            = GameObject.Find("ScriptHub").GetComponent <Main>();
     m_agentScript           = GameObject.Find("Agent").GetComponent <AgentInput>();
     m_humanScript           = GameObject.Find("P1").GetComponent <HumanInput>();
     m_sessionScript         = GameObject.Find("ScriptHub").GetComponent <SessionBehavior>();
     m_menuScript            = GameObject.Find("ScriptHub").GetComponent <MenuBehavior>();
     m_ballScript            = GameObject.Find("Ball").GetComponent <BallBehavior>();
     m_dataScript            = GameObject.Find("ScriptHub").GetComponent <DataManger>();
     ROLE_SERVER             = 0;
     ROLE_CLIENT             = 1;
     HUMAN_ID                = 0;
     HUMAN_LEFT              = 2;
     HUMAN_RIGHT             = 3;
     AGENT_ID                = 1;
     AGENT_SKILL_RANDOM      = 0;
     AGENT_SKILL_NORMAL      = 1;
     AGENT_SKILL_FAST        = 2;
     RALLY_ID                = 2;
     UNASSIGNED              = 10;
     INPUT_KEYBOARD          = 0;
     INPUT_MOUSE             = 1;
     INPUT_HYDRA             = 2;
     BALL_RADIUS_LARGE       = 2;
     BALL_RADIUS_MEDIUM      = 1;
     BALL_RADIUS_SMALL       = 0.5F;
     PADDLE_SIZE_LARGE       = 9.0757605F;   //150%
     PADDLE_SIZE_MEDIUM      = 6.050507F;    //100%
     PADDLE_SIZE_SMALL       = 4.53788025F;  //75%
     PADDLE_WIDTH_MEDIUM     = 7.41716F;
     RASyN_IP                = "127.0.0.1";
     RASyN_PORT_MAP          = new Dictionary <string, int> ();
     PONG_SERVER_ID          = "PongServer";
     PONG_CLIENT1_ID         = "PongClient1";
     PONG_CLIENT2_ID         = "PongClient2";
     ASSIGNED_PONG_CLIENT_ID = "NULL";
     RASyN_PORT_MAP.Add(PONG_SERVER_ID, 19000);
     RASyN_PORT_MAP.Add(PONG_CLIENT1_ID, 19011);
     RASyN_PORT_MAP.Add(PONG_CLIENT2_ID, 19012);
     jss = new JsonSerializerSettings();
     jss.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
     jss.MissingMemberHandling = MissingMemberHandling.Ignore;
     //jss.PreserveReferencesHandling = PreserveReferencesHandling.Objects;
     DRAW_TIMEOUT = 1000 * 60;         //60 second timeout in milliseconds
     BallUtils.InitBallUtilities();
     NetUtils.InitNetUtils();
     rallyCfg = new RallyConfiguration(Application.dataPath + "/Config/RallyConfiguration.json");
 }
Exemple #8
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            bundle = Intent.Extras;

            SetContentView(Resource.Layout.ViewChallenge);

            prefHelper  = new PreferenceHelper(this);
            dataManager = new DataManger(this);

            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            checkButton = FindViewById <BiggerFloatingActionButton>(Resource.Id.checkButton);
            var challengeName = FindViewById <TextView>(Resource.Id.challengeName);

            challange = new ChallengeDto
            {
                Id               = bundle.GetInt("CHALLENGE_ID"),
                Name             = bundle.GetString("NAME"),
                Duration         = bundle.GetInt("DURATION"),
                EntriesCompleted = bundle.GetInt("ENTRIES_COMPLETED"),
                LastEntryDate    = Utils.ToDateTimeNull(bundle.GetString("LAST_ENTRY_DATE"))
            };

            position = bundle.GetInt("POSITION");

            if (challange.CanCheck)
            {
                checkButton.BackgroundTintList = ColorStateList.ValueOf(Resources.GetColor(Resource.Color.colorPrimary));
                checkButton.Clickable          = true;
                checkButton.Click += CheckButton_Click;
            }
            else
            {
                checkButton.BackgroundTintList = ColorStateList.ValueOf(Resources.GetColor(Resource.Color.lightGray));
                checkButton.Clickable          = false;
            }

            challengeName.Text = challange.Name;

            SetActionBar(toolbar);

            ActionBar.Title = "Check It";
            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetHomeButtonEnabled(true);
        }
Exemple #9
0
    protected override LoopListViewItem2 OnGetItemByIndex(LoopListView2 listView, int index)
    {
        if (index < 0 || index >= DataManger.TotalItemCount)
        {
            return(null);
        }
        GridItemData itemData = DataManger.GetItemDataByIndex(index);

        if (itemData == null)
        {
            return(null);
        }
        LoopListViewItem2 item = listView.NewListViewItem(ItemName);

        for (int i = 0; i < row; i++)
        {
            int       itemIndex  = index * row + i;
            EquipItem itemScript = item.transform.GetChild(i).GetComponent <EquipItem>();
            if (itemIndex >= DataManger.TotalDataCount)
            {
                itemScript.gameObject.SetActive(false);
                continue;
            }
            else
            {
                itemScript.gameObject.SetActive(true);
            }
            itemScript.Init();
            itemScript.SetData(itemIndex, UnityEngine.Random.Range(1, 6), SpriteArray[UnityEngine.Random.Range(0, SpriteArray.Length)].name, UnityEngine.Random.Range(0, 2) == 1,
                               UnityEngine.Random.Range(1, 1000), UnityEngine.Random.Range(1, 6));
            itemScript.GetComponent <Button>().onClick.RemoveAllListeners();
            itemScript.GetComponent <Button>().onClick.AddListener(delegate
            {
                Debug.Log(itemScript.Index);
            });
        }
        return(item);
    }
Exemple #10
0
 public LentaController()
 {
     _dataManger = new DataManger();
 }
Exemple #11
0
 public TravelController()
 {
     _dataManager = new DataManger();
 }
Exemple #12
0
 public HomeController()
 {
     _dataManger = new DataManger();
 }