Skip to content

Commit

Permalink
Restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
Wait committed Jul 8, 2014
1 parent 9f49f0f commit 2bf68cf
Show file tree
Hide file tree
Showing 20 changed files with 331 additions and 241 deletions.
Binary file modified Quyd/Quyd.v12.suo
Binary file not shown.
Binary file modified Quyd/Quyd/Bin/Debug/Quyd.dll
Binary file not shown.
Binary file modified Quyd/Quyd/Bin/Debug/Quyd.pdb
Binary file not shown.
Binary file modified Quyd/Quyd/Bin/Debug/Quyd_Debug_AnyCPU.xap
Binary file not shown.
3 changes: 3 additions & 0 deletions Quyd/Quyd/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public MainPage()
{
InitializeComponent();

Item item = new StoreItem();
error.Text = (item as StoreItem).getPrice().ToString();

NavigationInTransition navigateInTransition = new NavigationInTransition();
navigateInTransition.Backward = new SlideTransition { Mode = SlideTransitionMode.SlideLeftFadeIn };
navigateInTransition.Forward = new SlideTransition { Mode = SlideTransitionMode.SlideRightFadeIn };
Expand Down
127 changes: 127 additions & 0 deletions Quyd/Quyd/Model/Item.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Parse;

namespace Quyd.Model
{
class ItemList
{
public IList<Item> itemList { get; private set; }
public bool imutable { get; private set; }

public ItemList()
{
itemList = new List<Item>();
imutable = false;
}

public ItemList(Store store)
{
itemList = new List<Item>();
imutable = false;

if(store.getOwnerId().Equals(ParseUser.CurrentUser))
{
imutable = true;
}
}

public ItemList(Post post)
{
itemList = new List<Item>();
imutable = false;
}
}

class Item
{
public ParseObject item { get; protected set; }

public Item()
{
item = null;
}

public Item(ParseObject item)
{
this.item = item;
}

public string getType()
{
return item.Get<string>("type");
}

public string getName()
{
return item.Get<string>("name");
}

public string getDescription()
{
return item.Get<string>("description");
}

public string getMaterial()
{
return item.Get<string>("material");
}

public string getMaterialType()
{
return item.Get<string>("materialType");
}

public string getIcon()
{
return item.Get<string>("icon");
}
}

class UserItem : Item, Quantifiable
{
public ParseObject userItem { get; private set; }

public UserItem()
{

}

public double getQuantity()
{
return userItem.Get<double>("quantity");
}

}

class StoreItem : Item, Priceable
{
public ParseObject storeItem { get; private set; }

public StoreItem()
{

}

public double getPrice()
{
return storeItem.Get<double>("price");
}
}

#region interface
interface Quantifiable
{
double getQuantity();
}

interface Priceable
{
double getPrice();
}
#endregion
}
161 changes: 0 additions & 161 deletions Quyd/Quyd/Model/Items.cs

This file was deleted.

Loading

0 comments on commit 2bf68cf

Please sign in to comment.