package com.sherpasteven.sscte.Models;

import android.content.Context;
import android.graphics.Bitmap;

import com.sherpasteven.sscte.Controllers.Controller;

import java.util.ArrayList;

/**
 * Created by joshua on 27/11/15.
 */
public class Friend extends Model{

    private String name;
    private String location;
    private String email;
    private Image profilepic;
    private Inventory inventory;

    private ProfileId profileId;

    public Friend(User user, Context context){

        setProfilePic(user.getProfilePic());
        setEmail(user.getEmail());
        setInventory(user.getInventory());
        setLocation(user.getLocation());
        setName(user.getName());
        profileId = new ProfileId(context);
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
        notifyViews();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
        notifyViews();
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
        notifyViews();
    }

    public Inventory getInventory() {
        return inventory;
    }

    public void setInventory(Inventory inventory) {
        this.inventory = inventory;
        notifyViews();
    }
    public Boolean hasInventoryItem(Card card){
        return getInventory().containsCard(card);
    }

    public Card returnInventoryItem(Card card){
        return getInventory().returnCard(card);
    }

    public Card getInventoryItem(int index){
        return getInventory().getCard(index);
    }

    public void removeInventoryItem(Card card, int amount){
        getInventory().removeCard(card, amount);
        notifyViews();
    }

    public Image getProfilePic() {
        return profilepic;
    }

    public void setProfilePic(Image profilepic) {
        this.profilepic = profilepic;
        notifyViews();
    }

    public Bitmap constructProfilePic(){
        return getProfilePic().constructImage();
    }


    public ProfileId getProfileId() {
        return profileId;
    }
}

@@ -256,192 +256,13 @@
 nds 
-Model%7B%0A%0A    private String name;%0A    private String location;%0A    private String email;%0A    private Image profilepic;%0A    private Inventory inventory;%0A%0A    private ProfileId profileId;
+User%7B
 %0A%0A  
@@ -306,17 +306,16 @@
 ntext)%7B%0A
-%0A
         
@@ -319,61 +319,49 @@
    s
-etProfilePic(user.getProfilePic());%0A        setEmail(
+uper(user.getName(), user.getLocation(), 
 user
@@ -371,16 +371,25 @@
 tEmail()
+, context
 );%0A     
@@ -441,601 +441,102 @@
  set
-Location(user.getLocation());%0A        setName(user.getName());%0A        profileId = new ProfileId(context);%0A    %7D%0A%0A    public String getEmail() %7B%0A        return email
+ProfilePic(user.getProfilePic())
 ;%0A    
-%7D%0A%0A
     
-public void setEmail(String email) %7B%0A        this.email = email;%0A        notifyViews();%0A    %7D%0A%0A    public String getName() %7B%0A        return name
+setFriends(null)
 ;%0A    
-%7D%0A%0A
     
-public void setName(String name) %7B%0A        this.name = name;%0A        notifyViews();%0A    %7D%0A%0A    public String getLocation() %7B%0A        return location;%0A    %7D%0A%0A    public void setLocation(String location) %7B%0A        this.location = location;%0A        notifyViews(
+setTrades(user.getTrades()
 );%0A 
@@ -545,988 +545,142 @@
  %7D%0A%0A
+%0A
     
-public Inventory getInventory() %7B%0A        return inventory;%0A    %7D%0A%0A    public void setInventory(Inventory inventory) %7B%0A        this.inventory = inventory;%0A        notifyViews();%0A    %7D%0A    public Boolean hasInventoryItem(Card card)%7B%0A        return getInventory().containsCard(card);%0A    %7D%0A%0A    public Card returnInventoryItem(Card card)%7B%0A        return getInventory().returnCard(card);%0A    %7D%0A%0A    public Card getInventoryItem(int index)%7B%0A        return getInventory().getCard(index);%0A    %7D%0A%0A    public void removeInventoryItem(Card card, int amount)%7B%0A        getInventory().removeCard(card, amount);%0A        notifyViews();%0A    %7D%0A%0A    public Image getProfilePic() %7B%0A        return profilepic;%0A    %7D%0A%0A    public void setProfilePic(Image profilepic) %7B%0A        this.profilepic = profilepic;%0A        notifyViews();%0A    %7D%0A%0A    public Bitmap constructProfilePic()%7B%0A        return getProfilePic().constructImage();%0A    %7D%0A%0A%0A    public ProfileId getProfileId() %7B%0A        return profileId
+@Override%0A    public ArrayList%3CFriend%3E getFriends() %7B%0A        throw new RuntimeException(%22This functionality is not permissable%22)
 ;%0A  

Add the friends