/* BBBond.m				 
 *
 * The Bond object handle everything that belongs to a bond.
 * This includes info on the connected atoms and the type of connection.
 *
 * For interface-info see the header file. The comments in this file mostly
 * cover only the real implementation details.
 *
 * Written by: 		Thomas Engel
 * Created:    		15.11.1993 (Copyleft)
 * Last modified: 	30.10.1994
 */

#import "BBBond.h"
#import <misckit/MiscString.h>

@implementation BBBond

- init
{
	self = [super init];
	if( !self ) return self;

	// OK. We really are an object...here we go with our init.
	
	[self setName:"?±?"];
	[self setImage:[NXImage findImageNamed:"BondIcon"]];
	[self setLeaf:YES];
	return self;
}

- connect:firstAtom to:secondAtom with:(char)aType
{
	fromAtom = firstAtom;
	toAtom = secondAtom;
	type = aType;
	
	return self;
}

- fromAtom
{
	return fromAtom;
}

- toAtom
{
	return toAtom;
}

- (char)type
{
	return type;
}

- molecule
{
	return [fromAtom molecule];
}

@end

/*
 * History: 30.10.94 Switched to the MiscString.
 *
 *			14.05.94 Its drag & drop able now.
 *
 *			09.03.94 Added the molecule query method.
 *
 *			14.01.94 Changed the representation of type and added the name
 *
 *			10.01.94 Changed some methods to work properly with our
 *					 new objectWell. But this object is still not used.
 *
 *			
 * Bugs: This implementaion is a bug because it is not ready anyway.
 */