MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / getMiniMapSpriteIndex

Method getMiniMapSpriteIndex

src/Savegame/BattleUnit.cpp:1987–2015  ·  view source on GitHub ↗

* Get the unit's minimap sprite index. Used to display the unit on the minimap * @return the unit minimap index */

Source from the content-addressed store, hash-verified

1985 * @return the unit minimap index
1986 */
1987int BattleUnit::getMiniMapSpriteIndex () const
1988{
1989 //minimap sprite index:
1990 // * 0-2 : Xcom soldier
1991 // * 3-5 : Alien
1992 // * 6-8 : Civilian
1993 // * 9-11 : Item
1994 // * 12-23 : Xcom HWP
1995 // * 24-35 : Alien big terror unit(cyberdisk, ...)
1996 if (isOut())
1997 {
1998 return 9;
1999 }
2000 switch (getFaction())
2001 {
2002 case FACTION_HOSTILE:
2003 if (_armor->getSize() == 1)
2004 return 3;
2005 else
2006 return 24;
2007 case FACTION_NEUTRAL:
2008 return 6;
2009 default:
2010 if (_armor->getSize() == 1)
2011 return 0;
2012 else
2013 return 12;
2014 }
2015}
2016
2017/**
2018 * Set the turret type. -1 is no turret.

Callers 1

drawMethod · 0.80

Calls 1

getSizeMethod · 0.45

Tested by

no test coverage detected