-



- - . 62


friend Group::remove_item (Item*);

public:

Group* get_group () {return group;};

};

class Group: public Item

{

public:

void cut ();

void move (Length deltax, Length deltay);

Boolean pick (Length px, Length py) = 0;

void ungroup () { };

private:

ItemSet* items;

public:

void add_item (Item*);

void remove_item (Item*);

ItemSet* get_items () {return items;}

};

, ( ) , :

void Group::add_item (Item* item)

{

item->group = this;

items->add (item);

}

void Group::remove_item (Item* item);

{

item->group = 0;

items->remove (item);

}

Group::add_item Group::remove_item (private) Item, Group, (friends) Item.

:

1)    : ;

2)    - : .

() . ItemSet ( ):

class ItemSet

{

public:

ItemSet(); //

~ItemSet(); //