how to compare 2 lists for equality - c#

even if value in dow and dy are equal,it doesnt enter inside the loop to check equality
foreach (DayOfWeek dow in daysofweek)
{
foreach (day dy in cleave.WeekDays)
{
if (Mode == 1)
{
//textBoxnumofdays.Text = Convert.ToString(span.Days+2);
if (dow.Equals(dy))
{
textBoxnumofdays.Text = Convert.ToString(span.Days - 1);
}
else
{
textBoxnumofdays.Text = Convert.ToString(span.Days + 2);
}
}
else
{
//textBoxnumofdays.Text = Convert.ToString(span.Days + 1);
if (dow.Equals(dy))
{
textBoxnumofdays.Text = Convert.ToString(span.Days - 1);
}
else
{
textBoxnumofdays.Text = Convert.ToString(span.TotalDays + 1);
}
}
}
}
public void Getdays()
{
DateTime dtFrom = new DateTime(dateTimePickerfromdate.Value.Year,
dateTimePickerfromdate.Value.Month, dateTimePickerfromdate.Value.Day);
DateTime dtTo = new DateTime(dateTimePickertodate.Value.Year,
dateTimePickertodate.Value.Month, dateTimePickertodate.Value.Day);
daysofweek = new List<DayOfWeek>();
cleave = new LeaveApplication(constr);
while (dtTo != dtFrom)
{
dtFrom = dtFrom.AddDays(1);
daysofweek.Add(dtFrom.DayOfWeek);
}
}

I presume you are trying to check if its a weekday or not
foreach (DayOfWeek dow in daysofweek)
{
}
So just compare it with like dow == DayOfWeek.Sunday and accept or ignore based on your requirement.

Because for each daysofweek it will do a full cycle of cleave.WeekDays, so it will probably activate first the if part and in the next cycle the else part. What are you trying to do?

Related

Loop methodn not giving accurate resuts

I have created file during the runtime process John.txt and there are properties for John. The text of the file is "friend,banker" but when I execute and ask the AI "where is John"? it doesnt return any results despite I wrote the method MatchProffesionWithProperties. Where Am I wrong?
namespace Machine
{
class Program
{
static bool HavingGreeted = false;
static string person;
static Dictionary<string, string> KeyValuePairs;
static void MatchProffesionsWithProperties(string person,DayOfWeek dayOfWeek)
{
var strings = File.ReadAllLines(person + ".txt");
foreach(var stringi in strings)
{
var whitespacearray = stringi.Split(' ');
var commaarray = stringi.Split(',');
foreach(var property in whitespacearray)
{
if (KeyValuePairs.ContainsKey(property))
{
if (dayOfWeek == DayOfWeek.Monday || dayOfWeek == DayOfWeek.Tuesday || dayOfWeek == DayOfWeek.Wednesday || dayOfWeek == DayOfWeek.Thursday || dayOfWeek == DayOfWeek.Friday)
{
Console.WriteLine("{0} should be at the {1}", person, KeyValuePairs[property]);
}
}
}
foreach(var property in commaarray)
{
if (KeyValuePairs.ContainsKey(property))
{
if (dayOfWeek == DayOfWeek.Monday || dayOfWeek == DayOfWeek.Tuesday || dayOfWeek == DayOfWeek.Wednesday || dayOfWeek == DayOfWeek.Thursday || dayOfWeek == DayOfWeek.Friday)
{
Console.WriteLine("{0} should be at the {1}", person, KeyValuePairs[property]);
}
}
}
}
}
static void ProcessQuestionForPerson(string word)
{
var array = word.Split(' ');
if (word.Contains("Wh"))
{
person = array[2].Substring(0,array[2].Length-1);
}
else
{
person = array[1];
}
if (!File.Exists(person+".txt"))
{
Console.WriteLine("Who is {0}?", person);
string data = Console.ReadLine();
var filestream = File.Create(person + ".txt");
byte[] b = ASCIIEncoding.ASCII.GetBytes(data);
filestream.Write(b, 0, b.Length);
filestream.Close();
}
else
{
if (word.StartsWith("Who"))
{
string data = File.ReadAllText(person + ".txt");
Console.WriteLine("{0} is a {1}", person, data);
}
if (word.StartsWith("Where"))
{
MatchProffesionsWithProperties(person, DateTime.Today.DayOfWeek);
}
}
}
static void Greet(int hour)
{
if (hour > 0 && hour < 12)
{
Console.WriteLine("Good Morning");
}
if (hour > 12 && hour < 17)
{
Console.WriteLine("Good Afternoon");
}
if (hour > 17 && hour <= 23)
{
Console.WriteLine("Good Evening");
}
}
static void ProcessQuestionForMyself(string word)
{
var array = word.Split(' ');
//Process the components of the sentence
string type = array[1];
// get the type of the sentence
string value = array[3].Substring(0,array[3].Length-1);
// get the value of the sentence
string questiontype = array[3].Substring(0,array[3].Length-1);
//get the type of the question
if (word.EndsWith("."))
{
string correctvalue = File.ReadAllText(type+".txt");
// read from file the correct value
if (type == "name")
{
if (correctvalue == GetLowerUpper(value)[0] || correctvalue == GetLowerUpper(value)[1])
{
Console.WriteLine("Correct.My name is {0}.", value);
// print response
}
else
{
Console.WriteLine("{0} is not my name.", value);
// print response
}
}
if (type == "age")
{
if (correctvalue == value)
{
Console.WriteLine("Correct.I am {0} years old.", value);
// print response
}
else
{
Console.WriteLine("{0} is not my age.", value);
// print response
}
}
}
if (word.EndsWith("?"))
{
string answer = File.ReadAllText(questiontype+".txt");
Console.WriteLine(answer);
}
}
static string[] GetLowerUpper(string word)
{
string upperword = word.Replace(word[0].ToString(), word[0].ToString().ToUpper());
string lowerword = word.ToLower();
//Create strings for answer and question0
string[] array = new string[2] { upperword, lowerword };
return array;
}
static void MainThread()
{
if (HavingGreeted == false)
{
Greet(DateTime.Now.Hour);
HavingGreeted = true;
}
string data = Console.ReadLine();
if (data.Contains(GetLowerUpper("your")[0]) || data.Contains(GetLowerUpper("your")[1]))
{
//Append to me
ProcessQuestionForMyself(data);
}
if (!data.Contains("your"))
{
//Append to someone else
ProcessQuestionForPerson(data);
}
// Repeat thread
Thread repeatmainthread = new Thread(new ThreadStart(MainThread));
repeatmainthread.Start();
}
static void Main(string[] args)
{
KeyValuePairs = new Dictionary<string, string>();
KeyValuePairs.Add("Banker", "Bank");
Thread mainthread = new Thread(new ThreadStart(MainThread));
mainthread.Start();
}
}
}
The expected result would be the AI to tell me that John should be at the bank.
KeyValuePairs.ContainsKey(property) is case-sensitive, so "banker" will not match "Banker". You can allow case-insensitive searching by changing the initialisation of KeyValuePairs to:
KeyValuePairs = new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase);
Changing ProcessQuestionForPerson to still ask a "Where is ..." question after creating a new file for that person:
static void ProcessQuestionForPerson(string word)
{
var array = word.Split(' ');
bool fileExisted = false;
if (word.Contains("Wh"))
{
person = array[2].Substring(0,array[2].Length-1);
}
else
{
person = array[1];
}
fileExisted = File.Exists(person+".txt");
if (!fileExisted)
{
Console.WriteLine("Who is {0}?", person);
string data = Console.ReadLine();
var filestream = File.Create(person + ".txt");
byte[] b = ASCIIEncoding.ASCII.GetBytes(data);
filestream.Write(b, 0, b.Length);
filestream.Close();
}
if (word.StartsWith("Who") && fileExisted) //We don't want to answer "Who" when we've just answered it ourselves (remove && fileExisted if you do)
{
string data = File.ReadAllText(person + ".txt");
Console.WriteLine("{0} is a {1}", person, data);
}
if (word.StartsWith("Where"))
{
MatchProffesionsWithProperties(person, DateTime.Today.DayOfWeek);
}
}

maximum and minimum value in list

I'm currently doing my current project and I had a problem. Here's what the project needs to do:
Find the maximum and the minimum temperature from a certain range of date. The range of the date will be inputted by the user.
So, I make a form as the main menu for inputting the items and finding the maximum and minimum value (both in the new form). I also make a class to store the items:
public class TempDate
{
public double Temp { get; set; }
public DateTime Date { get; set; }
}
In the first form, just call it FormAddData, from here items will be stored into the list using a textbox and here's the code:
private void buttonSubmit_Click(object sender, EventArgs e)
{
FormMenu formMenu = (FormMenu)this.Owner;
DateTime date = dateTimePickerDate.Value.Date;
double temp = double.Parse(textBoxTemp.Text);
TempDate tempDate = new TempDate();
tempDate.Date = date;
tempDate.Temp = temp;
formMenu.listOfTempDate.Add(tempDate);
listBoxInfo.Items.Add(date + "\t" + temp + "°C");
}
In the second form that called FormMaxMinRange. In this form, I use two DateTimePicker the first one for the starting date and the second for the ending date. From here I need to make a button that will select all the items from the range that I used from starting and ending date. Here's my code:
private void buttonMaxMin_Click(object sender, EventArgs e)
{
FormMenu formMenu = (FormMenu)this.Owner;
DateTime start = dateTimePickerStart.Value.Date;
DateTime end = dateTimePickerEnd.Value.Date;
int highest = 0;
double max = formMenu.listOfTempDate[0].Temp;
int lowest = 0;
double min = formMenu.listOfTempDate[0].Temp;
for (int i = 1; i < formMenu.listOfTempDate.Count; i++)
{
if (formMenu.listOfTempDate[i].Date >= start
&& formMenu.listOfTempDate[i].Date <= end)
{
if (formMenu.listOfTempDate[i].Temp > max)
{
highest = i;
max = formMenu.listOfTempDate[i].Temp;
}
if (formMenu.listOfTempDate[i].Temp < min)
{
lowest = i;
min = formMenu.listOfTempDate[i].Temp;
}
}
}
listBoxMaxMin.Items.Add("");
listBoxMaxMin.Items.Add("Lowest temp: " + min + ", on " + formMenu.listOfTempDate[lowest].Date);
listBoxMaxMin.Items.Add("Highest temp: " + max + ", on " + formMenu.listOfTempDate[highest].Date);
}
Here's the main form that i declared the class (which include the list):
public partial class FormMenu : Form
{
public List<TempDate> listOfTempDate = new List<TempDate>();
public FormMenu()
{
InitializeComponent();
}
private void fromCertainRangeToolStripMenuItem_Click(object sender, EventArgs e)
{
FormMaxMinRange formMaxMinRange = new FormMaxMinRange();
formMaxMinRange.Owner = this;
formMaxMinRange.ShowDialog();
}
}
But, the problem is, the minimum value was not selected inside the range of selection. Also I want the max and min value was printed in the listbox. Sorry for the long and weird question. I hope someone can understand what I means with this question to complete my project. Thank you.
See this code snippet.
You can use Linq to select the reduced list (with Start/Enddate) and order it by Temp. Now you can easy select the first (min) and the last (max) object.
List<TempDate> loTempDateList = new List<TempDate>()
{
new TempDate() {Date = DateTime.Now.AddDays(-10), Temp = 10.01 },
new TempDate() {Date = DateTime.Now.AddDays(-5), Temp = 20.01 },
new TempDate() {Date = DateTime.Now.AddDays(-3), Temp = 30.01 },
new TempDate() {Date = DateTime.Now, Temp = 40.01 }
};
DateTime ldStart = DateTime.Now.AddDays(-6);
DateTime ldEnd = DateTime.Now.AddDays(-1);
var loDateList = loTempDateList.Where(item => item.Date <= ldEnd && item.Date >= ldStart)
.OrderBy(item => item.Temp);
TempDate loMin = loDateList.First();
TempDate loMax = loDateList.Last();
Console.WriteLine("{0}: {1} with max temp", loMax.Date, loMax.Temp);
Console.WriteLine("{0}: {1} with min temp", loMin.Date, loMin.Temp);
Output (for today):
9/26/2017 3:17:09 PM: 30.01 with max temp
9/24/2017 3:17:09 PM: 20.01 with min temp
Update (with your variable names):
Copy this under DateTime end = dateTimePickerEnd.Value.Date;in your Form
var loDateList = listOfTempDate.Where(item => item.Date <= end && item.Date >= start)
.OrderBy(item => item.Temp);
TempDate loMin = loDateList.FirstOrDefault();
TempDate loMax = loDateList.LastOrDefault();
if (loMin != null && loMax != null)
{
listBoxMaxMin.Items.Add("");
listBoxMaxMin.Items.Add("Lowest temp: " + loMin.Temp + ", on " + loMin.Date);
listBoxMaxMin.Items.Add("Highest temp: " + loMax.Temp + ", on " + loMax.Date);
}
I would suggest you use Linq Max and Min methods.
// filter out only the dates in the range you need
var items = formMenu.listOfTempDateWhere(
item => ((TempDate)item).Date >= start && ((TempDate)item).Date <= end
);
// get the maximum value
var max = items.Max(item => item.Temp);
// get the minimum value
var min = items.Min(item => item.Temp);
Just remember to add using System.Linq on the top of your .cs file
try this online
If you don't like a LINQ approach (I never use LINQ, for some, possibly invalid reason, I think it's evil), you can override the List class and extend it with methods of your own.
public class TempDataList<T> : List<TempData>
{
public TempDataList() : base()
{
}
public TempDataList(IEnumerable<TempData> collection) : base(collection)
{
}
public TempData GetMaxTemp(DateTime startDate, DateTime endDate)
{
TempData highestTempData = null;
for (int i = 0; i < this.Count; i++)
{
if (this[i].Date >= startDate && this[i].Date <= endDate)
{
if (highestTempData == null || this[i].Temp > highestTempData.Temp)
{
highestTempData = this[i];
}
}
}
return highestTempData;
}
public TempData GetMinTemp(DateTime startDate, DateTime endDate)
{
TempData lowestTempData = null;
for (int i = 0; i < this.Count; i++)
{
if (this[i].Date >= startDate && this[i].Date <= endDate)
{
if (lowestTempData == null || this[i].Temp < lowestTempData.Temp)
{
lowestTempData = this[i];
}
}
}
return lowestTempData;
}
}
And fill the extended list and call the methods:
TempDataList<TempData> tempDataList = new TempDataList<TempData>();
tempDataList.Add(new TempData(10, DateTime.UtcNow));
tempDataList.Add(new TempData(20, DateTime.UtcNow));
tempDataList.Add(new TempData(15, DateTime.MinValue));
tempDataList.Add(new TempData(25, DateTime.MaxValue));
Console.WriteLine(tempDataList.GetMaxTemp(DateTime.UtcNow.AddDays(-1), DateTime.UtcNow.AddDays(1)).Temp);
Console.WriteLine(tempDataList.GetMinTemp(DateTime.UtcNow.AddDays(-1), DateTime.UtcNow.AddDays(1)).Temp);

Regex c# - where to insert the blank space

I want to allow the user to enter the year in blank but I don´t know where to put \s\s\s\s in the following expression.
Here is an example of what I need to do: if the user inserts 03-07-_____ the program must be executed every 3Th of July of each year(and it proceeds the same way if the user inserts blank date, month or year or twoo of this three)
System.Text.RegularExpressions.Regex rdate =
new System.Text.RegularExpressions.Regex(#"^((((0?[1-9]|[12]\d|3[01]|\s\s|\s\d)[\-](0?[13578]|1[02]|\s\s)[\-]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|[12]\d|30)[\-](0?[13456789]|1[012])[\-]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|1\d|2[0-8])[\-]0?2[\-]((1[6-9]|[2-9]\d)?\d{2}))|(29[\-]0?2[\-]((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00)))|(((0[1-9]|[12]\d|3[01])(0[13578]|1[02])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|[12]\d|30)(0[13456789]|1[012])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|1\d|2[0-8])02((1[6-9]|[2-9]\d)?\d{2}))|(2902((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00))))$");
Could someone help me?(this expression validates even a leap year)
Here is what You asked for
System.Text.RegularExpressions.Regex rdate =
new System.Text.RegularExpressions.Regex(#"^((((0?[1-9]|[12]\d|3[01]|\s\s|\s\d)[\-](0?[13578]|1[02]|\s\s)[\-]((1[6-9]|[2-9]\d)?\d{2}|\s\s\s\s))|((0?[1-9]|[12]\d|30)[\-](0?[13456789]|1[012])[\-]((1[6-9]|[2-9]\d)?\d{2}|\s\s\s\s))|((0?[1-9]|1\d|2[0-8])[\-]0?2[\-]((1[6-9]|[2-9]\d)?\d{2}|\s\s\s\s))|(29[\-]0?2[\-]((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00|\s\s\s\s)))|(((0[1-9]|[12]\d|3[01])(0[13578]|1[02])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|[12]\d|30)(0[13456789]|1[012])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|1\d|2[0-8])02((1[6-9]|[2-9]\d)?\d{2}))|(2902((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00))))$");
But I am not sure it is what You really want. The regex was already patched, I continued the way. But not only it is maintenance nightmare, it behaves strange. It accepts empty day, but only when month is january, march, may... or empty. Less lines of code is not always better. I would suggest to rewrite it completely. Something simmilar to this:
protected DateTime? getDateTimeFromParts(string day, string month, string year)
{
DateTime now = DateTime.Now;
int iyear;
if (string.IsNullOrWhiteSpace(year))
{
iyear = now.Year;
}
else
{
iyear = int.Parse(year);
if (iyear >= 0 && iyear < 100) { iyear += 2000; }
}
int imonth;
if (string.IsNullOrWhiteSpace(month))
{
imonth = now.Month;
}
else
{
imonth = int.Parse(month);
}
int iday;
if (string.IsNullOrWhiteSpace(day))
{
iday = now.Day;
}
else
{
iday = int.Parse(day);
}
if (iyear <= DateTime.MaxValue.Year && iyear >= DateTime.MinValue.Year)
{
if (imonth >= 1 && imonth <= 12)
{
if (DateTime.DaysInMonth(iyear, imonth) >= iday && iday >= 1)
return new DateTime(iyear, imonth, iday);
}
}
return null;
}
protected DateTime? getDateTime(string dateStr)
{
Regex r = new Regex(#"^(\d\d)(\d\d)((\d\d)?\d\d)$");
Match m = r.Match(dateStr);
if (m.Success)
{
return getDateTimeFromParts(m.Groups[1].Value, m.Groups[2].Value, m.Groups[3].Value);
}
r = new Regex(#"^(\d?\d|\s\d|\s\s)[-](\d?\d|\s\s)[-]((\d\d)?\d\d|\s\s\s\s)$");
m = r.Match(dateStr);
if (m.Success)
{
return getDateTimeFromParts(m.Groups[1].Value, m.Groups[2].Value, m.Groups[3].Value);
}
return null;
}

how to get the total selected days from 2 calendars in asp.net

just like in my questions, i have 2 calendars to be selected by users, and i would like to get the total selected days and be displayed in label.
users have to select the start date in lstartdate calendar and end date in lenddate calendar.
private void ValidateDate()
{
if (lstartdate.Text == "" || lenddate.Text == "")
{
lwarndate.Visible = true;
lwarndate.Text = "Dates required";
}
if (lstartdate.Text != "" || lenddate.Text != "")
{
if (cstart.SelectedDate > cend.SelectedDate)
{
lwarndate.Visible = true;
lwarndate.Text = "Start date must be earlier than end date!";
}
if (cstart.SelectedDate <= cend.SelectedDate)
{
lwarndate.Visible = false;
}
if (cend.SelectedDate != null && cstart.SelectedDate != null)
{
Double Value;
if (cend.SelectedDate >= cstart.SelectedDate)
Value = (cend.SelectedDate - cstart.SelectedDate).TotalDays;
else
Value = (cend.SelectedDate - cstart.SelectedDate).TotalDays;
total.Text = // ?
}
}
}
im not sure if the code arrangements are correct or not. do help and tq :)
TRY LIKE THIS
DateTime DtF = ceFromDate.SelectedDate.Value;
DateTime D1T = ceToDate.SelectedDate.Value;
double dd = (DtF - D1T).TotalDays;
total.Text = dd.ToString();
Here is simple way to get different between two dates
class Program
{
static void Main(string[] args)
{
System.DateTime dtTodayNoon = new System.DateTime(2006, 9, 13, 12, 0, 0);
System.DateTime dtTodayMidnight = new System.DateTime(2006, 9, 13, 0, 0, 0);
System.TimeSpan diffResult = dtTodayNoon.Subtract(dtYestMidnight);
Console.WriteLine("Yesterday Midnight - Today Noon = " + diffResult.Days);
Console.WriteLine("Yesterday Midnight - Today Noon = " + diffResult.TotalDays);
Console.ReadLine();
}
}
Source
you need to implement it yourself..
Convert the difference between the two dates into a TimeSpan, then get the amount of Days of that TimeSpan and set this as your text-value.
private void ValidateDate()
{
if (lstartdate.Text == "" || lenddate.Text == "")
{
lwarndate.Visible = true;
lwarndate.Text = "Dates required";
}
if (lstartdate.Text != "" || lenddate.Text != "")
{
if (cstart.SelectedDate > cend.SelectedDate)
{
lwarndate.Visible = true;
lwarndate.Text = "Start date must be earlier than end date!";
}else{
lwarndate.Visible = false;
}
if (cend.SelectedDate != null && cstart.SelectedDate != null)
{
TimeSpan duration = DateTime.Parse(cend.SelectedDate ).Subtract(DateTime.Parse(cstart.SelectedDate ));
total.Text = duration.Days.ToString();
}
}
}

C# List.Remove(object)

I have an object which is a List within a List:
public List<List<MyObject>> Grid { get; set; }
I have noticed that sometimes when I do:
Grid[currentShape.ColumnNumber].Remove(currentShape);
It removes two objects from the array.
The way in which I populate the Grid object is if a certain condition is met, then I basically do:
Grid[newShape.ColumnNumber].Add(newShape);
currentShape = newShape;
currentShape is a class variable which I use to move around the object on the screen. Is it because of a Reference Type that when I sometimes do .Remove(), it deletes more than one object from the array? Do I need to extend the .Remove() somehow?
Any help is highly appreciated.
Update - The entire method:
public void MoveIfPossible(MoveDirection direction)
{
List<Shape> neighbouringShapes = new List<Shape>();
switch (direction)
{
case MoveDirection.Right:
if (currentShape.ColumnNumber == utilities.columns.Count - 1)
return;
neighbouringShapes = GetNeighbouringShapes(currentShape.ColumnNumber);
foreach (var s in neighbouringShapes)
{
if (currentShape.Position.X + 1 < s.Position.X && currentShape.Position.Y + currentShape.Texture.Height >= s.Position.Y)
{
return;
}
}
world.Grid[currentShape.ColumnNumber].Remove(currentShape);
world.Grid[currentShape.ColumnNumber + 1].Add(currentShape);
currentShape.Position.X = utilities.columns[currentShape.ColumnNumber + 1].X;
currentShape.ColumnNumber++;
currentShape.Coordinate.X = currentShape.ColumnNumber;
currentShape.Coordinate.Y = world.Grid[currentShape.ColumnNumber].Count - 1;
break;
case MoveDirection.Left:
if (currentShape.ColumnNumber == 0)
return;
neighbouringShapes = GetNeighbouringShapes(currentShape.ColumnNumber - 1);
foreach (var s in neighbouringShapes)
{
if (currentShape.Position.X - 1 > s.Position.X && currentShape.Position.Y + currentShape.Texture.Height >= s.Position.Y)
{
return;
}
}
world.Grid[currentShape.ColumnNumber].Remove(currentShape);
world.Grid[currentShape.ColumnNumber - 1].Add(currentShape);
currentShape.Position.X = utilities.columns[currentShape.ColumnNumber - 1].X;
currentShape.ColumnNumber--;
currentShape.Coordinate.X = currentShape.ColumnNumber;
currentShape.Coordinate.Y = world.Grid[currentShape.ColumnNumber].Count;
break;
}
}

Categories

Resources