|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| TriangleArrayData.java | - | 75% | 75% | 75% |
|
||||||||||||||
| 1 |
/*
|
|
| 2 |
|
|
| 3 |
VRMoo Common - Virtual Reality Object Oriented MUD Common Code
|
|
| 4 |
Copyright (C) 2003 VRMoo Development Team
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
This program is free software; you can redistribute it and/or modify
|
|
| 8 |
it under the terms of the GNU General Public License as published by
|
|
| 9 |
the Free Software Foundation; either version 2 of the License, or
|
|
| 10 |
(at your option) any later version.
|
|
| 11 |
|
|
| 12 |
This program is distributed in the hope that it will be useful,
|
|
| 13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 15 |
GNU General Public License for more details.
|
|
| 16 |
|
|
| 17 |
You should have received a copy of the GNU General Public License
|
|
| 18 |
along with this program; if not, write to the Free Software
|
|
| 19 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
| 20 |
|
|
| 21 |
|
|
| 22 |
For information about VRMoo and its authors, please visit the website:
|
|
| 23 |
http://www.vrmoo.org/
|
|
| 24 |
|
|
| 25 |
*/
|
|
| 26 |
|
|
| 27 |
package org.vrmoo.common.data;
|
|
| 28 |
|
|
| 29 |
import org.vrmoo.common.exception.VRMooParseException;
|
|
| 30 |
|
|
| 31 |
/**
|
|
| 32 |
* Stores the 3D data that will go into a <code>TriangleArray</code>. Also
|
|
| 33 |
* contains functionality for writing out the data into a text format, and
|
|
| 34 |
* parsing that same text format.
|
|
| 35 |
*
|
|
| 36 |
* @author Jeff Weston
|
|
| 37 |
*/
|
|
| 38 |
public class TriangleArrayData extends ArrayData |
|
| 39 |
{
|
|
| 40 |
/**
|
|
| 41 |
* Construct an instance of this class with no data initially.
|
|
| 42 |
*/
|
|
| 43 | 5 |
public TriangleArrayData( )
|
| 44 |
{
|
|
| 45 | 5 |
super( );
|
| 46 |
} |
|
| 47 |
|
|
| 48 |
/**
|
|
| 49 |
* Construct an instance of this class using text representing encoded
|
|
| 50 |
* <code>TriangleArray</code> data.
|
|
| 51 |
*
|
|
| 52 |
* @param data the encoded <code>TriangleArray</code> data
|
|
| 53 |
*
|
|
| 54 |
* @throws VRMooParseException for any parsing errors that occur
|
|
| 55 |
*/
|
|
| 56 | 1 |
public TriangleArrayData( String data ) throws VRMooParseException |
| 57 |
{
|
|
| 58 | 1 |
super( data );
|
| 59 |
} |
|
| 60 |
|
|
| 61 |
/**
|
|
| 62 |
* Get the data type we are parsing in this subclass of
|
|
| 63 |
* <code>ArrayData</code>.
|
|
| 64 |
*
|
|
| 65 |
* @return the data type we are parsing
|
|
| 66 |
*/
|
|
| 67 | 7 |
protected String getDataType( )
|
| 68 |
{
|
|
| 69 | 7 |
return "TriangleArray"; |
| 70 |
} |
|
| 71 |
|
|
| 72 |
/**
|
|
| 73 |
* Parse a single item of the array.
|
|
| 74 |
*
|
|
| 75 |
* @param data the data for the single item to parse
|
|
| 76 |
*
|
|
| 77 |
* @return the parsed item
|
|
| 78 |
*
|
|
| 79 |
* @throws VRMooParseException for any parsing errors that occur
|
|
| 80 |
*/
|
|
| 81 | 0 |
protected ItemData parseItem( String data ) throws VRMooParseException |
| 82 |
{
|
|
| 83 | 0 |
return new TriangleData( data ); |
| 84 |
} |
|
| 85 |
} |
|
| 86 |
|
|
||||||||||