Beispiel #1
0
        public Sled BuildFromRow(DataRow row)
        {
            var returnRecord = Sled.BuildSledFromRow(row);

            returnRecord = this.BuildExtraFromRow <Sled>(returnRecord, row);
            return(returnRecord);
        }
Beispiel #2
0
        public string Part1()
        {
            var map      = new Map(InputFileAsStringList);
            var sled     = new Sled(map, 3, 1);
            var treesHit = sled.SlideDownMap();

            return($"Trees hit : {treesHit}");
        }
Beispiel #3
0
        public Sled Insert(Sled record)
        {
            DataRow row = this.dataSet.ttblsled.NewttblsledRow();

            this.UpdateToRow(ref row, record);
            this.ExtraUpdateToRow(ref row, record);
            this.dataSet.ttblsled.AddttblsledRow((pdssledDataSet.ttblsledRow)row);
            this.SaveChanges();
            return(this.dataSet.ttblsled.Rows.Count > 0 ? this.BuildFromRow(this.dataSet.ttblsled.Rows[0]) : null);
        }
Beispiel #4
0
        public Sled GetByRowId(string rowId, string fldList)
        {
            var  row  = this.GetRowByRowId(rowId, fldList);
            Sled sled = null;

            if (row != null)
            {
                sled = this.BuildFromRow(row);
            }
            return(sled);
        }
Beispiel #5
0
        protected Sled Fetch(string where, int batchsize, string fldList)
        {
            this.FetchWhere(where, batchsize, fldList);
            var  row  = this.dataSet.ttblsled.AsEnumerable().SingleOrDefault();
            Sled sled = null;

            if (row != null)
            {
                sled = this.BuildFromRow(row);
            }
            return(sled);
        }
Beispiel #6
0
        private void DeleteUseRowID(Sled record)
        {
            var row = this.GetRowByRowId(record.rowID, string.Empty);

            if (row == null)
            {
                row = this.dataSet.ttblsled.NewttblsledRow();
                Sled.BuildMinimalRow(ref row, record);
                this.dataSet.ttblsled.AddttblsledRow((pdssledDataSet.ttblsledRow)row);
            }
            row.Delete();
            this.SaveChanges();
        }
Beispiel #7
0
        public Sled Update(Sled record)
        {
            var row = this.GetRowByRowpointer(record.rowpointer, string.Empty);

            if (row != null)
            {
                this.UpdateToRow(ref row, record);
                this.ExtraUpdateToRow(ref row, record);
                this.SaveChanges();
                return(this.dataSet.ttblsled.Rows.Count > 0 ? this.BuildFromRow(this.dataSet.ttblsled.Rows[0]) : null);
            }
            ErrorReportingHelper.ReportErrors("global.update.doesnotexist", 421);
            return(null);
        }
Beispiel #8
0
    // Use this for initialization
    void Start()
    {
        //Set Variables
        currState     = State.Menu;
        prevState     = State.GameOver;
        canvas        = GameObject.Find("Canvas");
        instructIndex = 1;

        //Prep
        canvas.SetActive(true);
        Time.timeScale = 0;
        tempSled       = new Sled();
        tempSled.time  = float.MaxValue;
        numFinished    = 0;
    }
Beispiel #9
0
        public string Part2()
        {
            var map   = new Map(InputFileAsStringList);
            var sleds = new Sled[5] {
                new Sled(map, 1, 1),
                new Sled(map, 3, 1),
                new Sled(map, 5, 1),
                new Sled(map, 7, 1),
                new Sled(map, 1, 2)
            };

            long result = 1;

            foreach (var sled in sleds)
            {
                result *= sled.SlideDownMap();
            }

            return($"Combination of Trees hit : {result}");
        }
Beispiel #10
0
 public Sled Update(Sled record)
 {
     return(this.adapter.Update(record));
 }
Beispiel #11
0
 public void Delete(Sled record)
 {
     this.repository.Delete(record);
 }
Beispiel #12
0
 public Sled Update(Sled record)
 {
     return(this.repository.Update(record));
 }
Beispiel #13
0
 public Sled Insert(Sled record)
 {
     return(this.repository.Insert(record));
 }
Beispiel #14
0
 public Sled Insert(Sled record)
 {
     return(this.adapter.Insert(record));
 }
Beispiel #15
0
 public void Awake()
 {
     instance = this;
 }
Beispiel #16
0
 public void UpdateToRow(ref DataRow row, Sled record)
 {
     Sled.UpdateRowFromSled(ref row, record);
     this.ExtraUpdateToRow(ref row, record);
 }
Beispiel #17
0
 public void Delete(Sled record)
 {
     this.adapter.Delete(record);
 }